Between date query

Results 1 to 3 of 3

Thread: Between date query

  1. #1
    darin Guest

    Default Between date query

    Hi all,<BR>I&#039m trying to use the query below, but its not working please help!<BR>SELECT EVERYTHING FROM TABLE WHERE TODAYSDATE BETWEEN GETDATE()AND DATEADD("DAY",-5,GETDATE())<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Between date query

    Your going to need to replace EVERYTHING with the * key(the shift-8 key)<BR><BR>Also when querying with dates you need to surround your dates with the # key(the shift-3 key)<BR><BR>YOu can probably do a search here for # and get examples.<BR><BR>HTH<BR>Daniel

  3. #3
    Mip Guest

    Default RE: Between date query

    Try this<BR><BR>Dim StartDate, EndDate <BR>EndDate = Date()<BR>StartDate = DateAdd("d", -5, EndDate)<BR><BR>sql= "SELECT * FROM tablename where todaysdate BETWEEN #"& StartDate &"# AND #" & EndDate &"#"<BR><BR>Good Luck<BR><BR><BR>

Posting Permissions

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