We help IT Professionals succeed at work.

A date-time is required here. Crystal Report

peterdevadoss
on
Medium Priority
6,609 Views
Last Modified: 2008-01-09
I am passing the record selection forluma using the following code:
 report.DataDefinition.RecordSelectionFormula =
"{trans_dtl_conso.transaction_date}='" & Format(dtpFrom.Value, "MM-d-yyyy")  & "'"

Following error message appears:
A date-time is required here.
Error in File ...report file name dot rpt;
Error in formula <Record_Selection>.
'{trans_dtl_conso.transaction_date}='03-1-2006'
A date-time is required here.

datastruce of transaction_date is datetime in sqlserver.
I want to validate only the date.
Comment
Watch Question

within crystal you probably need to use #03-1-2006# to pass the date; you are just passing a formula to crystal, crystal is talking to sql

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Brian CroweDatabase Engineer
CERTIFIED EXPERT
Top Expert 2005
Commented:
johnson is correct try...

report.DataDefinition.RecordSelectionFormula =
"{trans_dtl_conso.transaction_date}=#" & dtpFrom.Value.tostring("MM-d-yyyy")  & "#"
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.