Problem of Date with MS Access

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Problem of Date with MS Access

    I am trying to display the records which the date (the Name field is Period) are greater than today's date from MS Access. It works fine except that I cannot display any records for April. Please find the below query and help to resove the problem and many thanks in advance.

    reqSQL = "Select EDate,Url, Title, Sdate, Edate, Address, Organiser FROM Train_Events WHERE CDATE(Period) >= #" & getToDate & "#" & " ORDER BY CDATE(Period)"
    brad Guest

  2. Similar Questions and Discussions

    1. date query problem, date in variable
      I am using the following query : $query_archief = "SELECT * FROM vacatures where dd_eind_plaatsing < $dd_eind_plaatsing_archief1" note:...
    2. Access date parameter problem
      I have been struggling with this for days. I am using a form to retrieve a list of dates and of store numbers. The user selects a date and store...
    3. MS Access time and date problem
      As the topic summary says, I am having trouble inserting both time and dates into a MS Access database. My database has three fields, eventdate,...
    4. Access SQL- Date comparison problem
      I use an Access-database where one column stores a date originating from this code: Indate = FormatDateTime(date(),vbgeneraldate) I then want...
    5. ASP - Access - Date() problem...
      In Access, the Format property* effects only the manner in which the date is displayed, not how it is stored. Jet stores dates a a Double number,...
  3. #2

    Default Re: Problem of Date with MS Access

    "brad" <anonymous@discussions.microsoft.com> wrote in message
    news:4B1CD25D-40A0-4682-9C47-5A226E3F9421@microsoft.com...
    > I am trying to display the records which the date (the Name field is
    Period) are greater than today's date from MS Access. It works fine except
    that I cannot display any records for April. Please find the below query
    and help to resove the problem and many thanks in advance.
    >
    > reqSQL = "Select EDate,Url, Title, Sdate, Edate, Address, Organiser
    FROM Train_Events WHERE CDATE(Period) >= #" & getToDate & "#" & " ORDER BY
    CDATE(Period)"

    If the column "Period" is a date field, there is no need to use the CDATE
    function. Also, your "getToDate" must be in the format mm/dd/yyyy

    --
    John Blessing

    [url]http://www.LbeHelpdesk.com[/url] - Help Desk software priced to suit all
    businesses
    [url]http://www.free-helpdesk.com[/url] - Completely free help desk software !
    [url]http://www.lbetoolbox.com[/url] - Remove Duplicates from MS Outlook


    John Blessing Guest

  4. #3

    Default Re: Problem of Date with MS Access

    Thanks for ur reply! I have tried to remove the CDATE but the problem remains. My getToDate format is dd/mm/yyyy and same as the "period" column" Does the date has to be in mm/ddyyy format to make the sorting correct? Pls advise
    brad Guest

  5. #4

    Default Re: Problem of Date with MS Access



    "brad" <anonymous@discussions.microsoft.com> wrote in message
    news:5F6A79A3-C8C4-497D-980F-115EBD38B67C@microsoft.com...
    > Thanks for ur reply! I have tried to remove the CDATE but the problem
    remains. My getToDate format is dd/mm/yyyy and same as the "period" column"
    Does the date has to be in mm/ddyyy format to make the sorting correct? Pls
    advise

    Yes, use mm/dd/yyyy. If the period column is a date column it doesn't have a
    'format', it is a date. It's like saying I have numeric column and it's
    format is nnn,nnn.nn. Don't confuse the internal storage format of a
    datatype with the way your computer presents it to you.

    Regards

    John Blessing
    [url]http://www.LbeHelpdesk.com[/url] - Help Desk software at affordable prices
    [url]http://www.free-helpdesk.com[/url] - Completely free help desk software !
    [url]http://www.lbetoolbox.com[/url] - Remove Duplicates from MS Outlook



    John Blessing Guest

  6. #5

    Default Re: Problem of Date with MS Access

    > Also, your "getToDate" must be in the format mm/dd/yyyy

    Actually, the only safe format to pass to Access is YYYY-MM-DD. Anything
    else can be misconstrued based on regional settings, etc... which can change
    at any time.

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]


    Aaron Bertrand [MVP] Guest

  7. #6

    Default Re: Problem of Date with MS Access

    Thank you all of your reply
    My regional setting has to be dd/mm/yyyy. How can I change the MS access to yyyy/mm/dd in the Period column. there is no such format in the drop down box. Pls advise again. Many thanks
    brad Guest

  8. #7

    Default Re: Problem of Date with MS Access

    Don't worry about the format that's stored within Access. In fact, what you
    see in the Access GUI is not what's stored at all.

    Worry about how you *present* it to the user, and how you get it into the
    database in the first place. You can manipulate the date format in both
    directions using VBScript, not some drop-down in the Access GUI...

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]





    "brad" <anonymous@discussions.microsoft.com> wrote in message
    news:8D9258F5-7DC9-4C6D-8C93-24C4966E3D5E@microsoft.com...
    > Thank you all of your reply!
    > My regional setting has to be dd/mm/yyyy. How can I change the MS access
    to yyyy/mm/dd in the Period column. there is no such format in the drop down
    box. Pls advise again. Many thanks


    Aaron Bertrand [MVP] Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139