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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Parameter Syntax with Crystal 8.5

Status
Not open for further replies.

mushin

Programmer
Oct 4, 2000
49
I wrote a report using a date in my select stmt and all was well. When I made that date a parameter in CR and let it generate the sql stmt I get:

SELECT
TIME_BLOCK1."start_date", TIME_BLOCK1."start_tick", TIME_BLOCK1."end_tick", TIME_BLOCK1."activity_description", TIME_BLOCK1."group_code"
FROM
"ADMIN"."TIME_BLOCK" TIME_BLOCK1
WHERE
TIME_BLOCK1."start_date" = {d '1900-01-01'}

The system crashes each time (Dr.Watson). What is CR doing
with this {d '1900-01-01') stuff ?
If I write a test qry in sql I use '2001-01-01' and get good results.....How do I get CR to generate a good format ?
 
That should work. Is it a DateTime field? Let's try this using a different method. Go to REPORTS --> EDIT SELECTION FORMULA --> RECORD. Then double click on the field (TIME_BLOCK1.start_date) in the upper left corner. It will then appear in the lower portion of the screen. After that, type " = Date(1900,01,01)" (without the ""). It should end up looking like this:

{TIME_BLOCK1.start_date} = Date(1900,01,01)

You can then view the SQL Query and it will show you what should be there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top