Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create date parameter

Status
Not open for further replies.

smalley

Programmer
Feb 8, 2001
17
0
0
US
I am fairly new to Crystal and I have no idea how to create a date parameter. I am using Crystal 8.0.1. I created a query using Crystal SQL builder and have created a report based on the query. I created a parameter called "ImportDate" and gave it data type "date". I created the following formula:
QUERY.CHECK_IMPORT_DATE = {?ImportDate}
I receive an error telling me that a string is expected. I changed the data type of my parameter to a string and ran the query again.
When prompted for a value, I entered:
Date("05/25/2001") and I tried 05/25/2001
Neither of these return any data.

Please help!! Thanks.
 
I figured out what the problem was. It was expecting a date and time:
2000-08-07 00:00:00.00

How do I get it to accept only a date?
 
Open the Insert fields window, click on the parameters tab, select the paprameter and click the edit button. In the value type combo box, change the value to "date". Click OK and try it again.

Thee instructions are for CR7 but should be about the same for 8.
 
The SQL designer converts some DateTimes to Strings. You can write a formula in the report to convert it to a true date:


DateValue(DTSToDateTime({Query.Date}))


Then use this formula with the date parameter in your selection formula. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top