Results 1 to 9 of 9

Thread: [RESOLVED] Date Problem with Crystal 8.5 SQL Query

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2006
    Posts
    20

    Resolved [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!

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Sep 2006
    Posts
    20

    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?

  3. #3
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: Date Problem with Crystal 8.5 SQL Query

    SYSDATE

    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??

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Sep 2006
    Posts
    20

    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.

  5. #5
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: Date Problem with Crystal 8.5 SQL Query


    But you are using it with formula or the query with the crviewer.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Sep 2006
    Posts
    20

    Re: Date Problem with Crystal 8.5 SQL Query

    I am using it with the SQL Query under Database - Show SQL Query.

  7. #7
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    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?
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  8. #8
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up 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.

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Sep 2006
    Posts
    20

    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width