+ Reply to Thread
Results 1 to 3 of 3

Thread: Query with Current Date

  1. #1
    Registered User jorame How long am I stuck at *ZEROS?
    Join Date
    Mar 2010
    Location
    California
    Posts
    1
    Rep Power
    0

    Query with Current Date

    Hi guys,

    I'm trying to create a QMQRY but I missing one of the field selection which is the date. This is my SQL:

    SELECT
    ALL T01.CDCASN, T01.CDAREA, T01.CDSTYL, T01.CDCOLR, T01.CDSDIM,
    T01.CDPAKU
    FROM WM242BASD/CDCART00 T01,
    WM242BASD/CHCART00 T02
    WHERE CDCASN = CHCASN
    AND( CDCASN = CHCASN
    AND CHSTAT = '10'
    AND CDDCR = 'CURRENT_DATE')
    ORDER BY T01.CDCASN ASC, T01.CDAREA ASC

    How can I pull date where field CDDCR (Created Date) is equal to current date? Any help would be really appreciated.

  2. #2
    Admin kitvb1 You are master of all that is CLLE kitvb1 You are master of all that is CLLE kitvb1 You are master of all that is CLLE kitvb1 You are master of all that is CLLE kitvb1 You are master of all that is CLLE kitvb1 You are master of all that is CLLE kitvb1 You are master of all that is CLLE kitvb1 You are master of all that is CLLE kitvb1 You are master of all that is CLLE kitvb1 You are master of all that is CLLE kitvb1 You are master of all that is CLLE kitvb1's Avatar
    Join Date
    Aug 2007
    Location
    Trebgast, Germany
    Posts
    1,708
    Rep Power
    2459

    Re: Query with Current Date

    You are testing the contents of CDDCR being equal to 'CURRENT_DATE' --> note the apostrophes.
    Regards

    Kit
    www.changefit.com
    (free) Change Management Systems for IT
    (free) Cross Reference Software for IT
    ___________________________________
    "The person who says it can't be done...
    should not interrupt the person doing it!" Chinese proverb

  3. #3
    Debug Junkie Denny You can get points if you post more! Denny You can get points if you post more! Denny You can get points if you post more! Denny You can get points if you post more! Denny You can get points if you post more! Denny You can get points if you post more! Denny You can get points if you post more! Denny You can get points if you post more! Denny You can get points if you post more! Denny You can get points if you post more! Denny You can get points if you post more! Denny's Avatar
    Join Date
    Feb 2004
    Location
    Gainesville, GA USA
    Age
    64
    Posts
    165
    Rep Power
    787

    Re: Query with Current Date

    Current_date should NOT be in quotes.
    Denny

    If authority was mass, stupidity would be gravity.

+ Reply to Thread

Similar Threads

  1. Code needed urgently for Current date
    By amitabh1_1 in forum RPG/RPGLE
    Replies: 9
    Last Post: February 9th, 2010, 08:36 AM
  2. How to Set Current Date/Time in PFTBL
    By Vishal in forum SQL
    Replies: 7
    Last Post: July 25th, 2009, 06:17 AM
  3. Current system date
    By rtenali in forum RPG/RPGLE
    Replies: 3
    Last Post: January 4th, 2007, 04:52 AM
  4. query/400 date arithmetic error
    By ronze in forum RPG/RPGLE
    Replies: 5
    Last Post: June 17th, 2005, 01:09 PM
  5. Replies: 3
    Last Post: February 16th, 2005, 08:36 AM

Bookmarks

Bookmarks

Posting Permissions

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