Weird! Problem of query the date for January and October

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

  1. #1

    Default Weird! Problem of query the date for January and October

    It's weird! I am writing an asp code to retireving data
    from the MS access. Any records before today will not be
    populated. It works fine except that I could not get any
    result for the month of January 2004 and October 2004 at
    all. What's wrong. please asvise. Many thanks!



    Dim getToDate
    getToDate = now
    ....
    ....
    ....
    reqSQL = "Select EDate,Url, Title, Sdate, Edate,
    Address, Organiser, Venue, Fee, Target, Category FROM
    Train_Events WHERE CDATE(Period) >='" & CDATE(getToDate)
    & "'" & " ORDER BY CDATE(Period)"
    rudolf 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. More Date Query Problem
      Hi, I have written the code below to return only data that are recorded this month: <cfquery name="getInfo" datasource="main_acc" dbtype="odbc">...
    3. Problem with ADO query against a DBF date field
      Marit, Jet and VBScript use the same underlying numeric representations of date/time values, and your best bet is to pass your value as a numeric...
    4. [PHP] Weird Date problem driving me crazy...
      Thanks John, your answer is right on the $$$. Changing the query to something like : SELECT UNIX_TIMESTAMP(ProblemStart) as ProblemStart solved...
    5. Weird Date problem driving me crazy...
      I have two date strings coming out from MySQL. Both fields are defined as datetime. When i come to print them like this : Echo"<B>Ticket...
  3. #2

    Default Re: Weird! Problem of query the date for January and October



    rudolf wrote:
    > It's weird! I am writing an asp code to retireving data
    > from the MS access. Any records before today will not be
    > populated. It works fine except that I could not get any
    > result for the month of January 2004 and October 2004 at
    > all. What's wrong. please asvise. Many thanks!
    >
    >
    >
    > Dim getToDate
    > getToDate = now
    > ...
    > ...
    > ...
    > reqSQL = "Select EDate,Url, Title, Sdate, Edate,
    > Address, Organiser, Venue, Fee, Target, Category FROM
    > Train_Events WHERE CDATE(Period) >='" & CDATE(getToDate)
    > & "'" & " ORDER BY CDATE(Period)"
    With MS Access date values need to be delimited by #:
    [url]http://www.aspfaq.com/show.asp?id=2040[/url]
    --

    Martin Honnen
    [url]http://JavaScript.FAQTs.com/[/url]

    Martin Honnen Guest

  4. #3

    Default Re: Weird! Problem of query the date for January and October

    It works!Thanks a lot!

    rudolf 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