[RESOLVED] Date Problem with Crystal 8.5 SQL Query
Hi. I am using the SQL Query in Crystal 8.5 to run a select statement. When I run it, it gives no errors, but returns no data. When I run the same query in SQL Plus, it returns records. I believe the offending piece of code is:
"FREQUENCY_DATA"."FREQUENCY_DATE" = TO_CHAR(SYSDATE - 1, 'DD-MON-YY')
this is in my where clause and when I remove it on Crystal, it returns all records. When I keep it in there like I said, no records, but it will return records on SQL Plus. Any assistance would be greatly appreciated!
Re: Date Problem with Crystal 8.5 SQL Query
It also works when I use actual dates instead of sysdate. Am I using sysdate incorreclty?
Re: Date Problem with Crystal 8.5 SQL Query
If you want to use system date In the crystal report then take it from the othere table and call from there.
What is sysdate??
Re: Date Problem with Crystal 8.5 SQL Query
sysdate is what you use to get the system date on Oracle databases. It's not in a table, it's a system generated thing.
Re: Date Problem with Crystal 8.5 SQL Query
But you are using it with formula or the query with the crviewer.
Re: Date Problem with Crystal 8.5 SQL Query
I am using it with the SQL Query under Database - Show SQL Query.
Re: Date Problem with Crystal 8.5 SQL Query
Quote:
Originally Posted by ydarb
I am using it with the SQL Query under Database - Show SQL Query.
How would you use it in a VB6 Program?
Re: Date Problem with Crystal 8.5 SQL Query
Quote:
Originally Posted by ydarb
I am using it with the SQL Query under Database - Show SQL Query.
Post the query and code of the crystal report how you are using, I want to test the code. :wave:
Re: Date Problem with Crystal 8.5 SQL Query
Hi, I was able to resolve this using the Crystal functions and using Current date rather that embedding sysdate within my sql query. Thanks for all the posts!