Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2006
    Posts
    65

    Unanswered: unusual data querying different dates

    i am using the following code to manipulate data from various dates: >=[paramStartDate] And <=[paramEndDate],the dates from and to include
    01-04-2005 and 31-03-2006, this displays the field names but not any records, however when i use the date from 01-04-2000 to 31-03-2006, then it shows records. I have checked the database and records for the first date DO exist, so why are they not being displayed, can someone please tell me? thanks in advance

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you need to be carfeul how you specify dates within SQL & JET-SQL in particular
    the help system is failry helpfull on this matter

    JET tends to default to use the US system MM-DD-YYYY
    sometimes you need to bracket dates with the hash symbol #.
    you can use the between clause for dates

    eg
    mysql = "select blah from <mytable> where <mydatecolumn> between #" & format([paramStartDate],"mm-dd-yyyy") & "# and #" & format([paramEndDate],"mm-dd-yyyy") & "#;"
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Apr 2006
    Posts
    65
    healdem,

    i have used exactly the same query for another instance of the same database and it worked fine

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    hence why I prefaced the comment with

    "you need to be carfeul how you specify dates within SQL & JET-SQL in particular
    the help system is fairly helpfull on this matter"
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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