Re: SQL Statement BETWEEN 2 Dates - Advice Please.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Aaron [SQL Server MVP] (ten.xoc_at_dnartreb.noraa)
Date: 08/11/04


Date: Wed, 11 Aug 2004 16:00:02 -0400

Stop using ambiguous date formats! I can't tell if you mean January 8th or
August 1st, how do you expect the software to know?

WHERE IDate >= #2004-08-01# AND IDate < #2004-08-10#

-- 
http://www.aspfaq.com/
(Reverse address to reply.)
"TomT" <tomt@adslweb.co.uk> wrote in message
news:411a7a83$0$20243$cc9e4d1f@news-text.dial.pipex.com...
> strList = "select * " _
>   & "from tbltest "_
>   & "WHERE user LIKE '%" & Replace(strSearch, "'", "''") & "%'  AND ID <
'2'
> "_
>   & "AND IDate Between #01/08/2004# AND #09/08/2004# " _
>   & "order by CDATE(IDate)"
>
>   This works but it shows all dates not just the ones between the 2
dates...
>
>   The access MDB has the 'IDate' formated as Date/Time.
>
>   How do I correct this ??
>
>   Thanks
>
>


Relevant Pages

  • Re: bad advice
    ... disappear so easily as formats become obsolete ... ... The BBC project was ported to the PC, but the site unfortunately died along with its originator in 2008. ... NUNS! ... Reverse!" ...
    (uk.rec.sheds)
  • Re: create date from text
    ... >Can't get any shorter than that. ... >Just have to reverse the order of J1 and K1 for UK formats ... Roger, I just checked that and I don't believe you have to reverse it. ...
    (microsoft.public.excel)
  • Re: wierd us/uk date toggling issue
    ... Stop using ambiguous date formats and/or format the date yourself? ... (Reverse address to reply.) ... "mark | r" wrote in message ... > between the us and uk (ddmmyyyy) ...
    (microsoft.public.inetserver.asp.general)
  • RE: VBA Conditional formatting
    ... You should be able to just reverse the statement. ... > I can change the conditional formats of cells with the ... > formats from a cell in Excel to show them in VBA? ...
    (microsoft.public.excel.misc)
  • Re: Time Format in Excel
    ... Access date/time fields store points in time encoded as real numbers. ... Duration = EndTime - SetupTime ... depending on the date/time formats you're using!). ... I want to Sum the duration column into a total number of hours. ...
    (microsoft.public.access.externaldata)