Re: Use of DateSelect in SQL filter

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

From: TC (no_at_email.here)
Date: 05/03/04


Date: Mon, 3 May 2004 13:55:02 +0930

Not to answer your question, but:- this kind of code is asking for trouble:

   ... BETWEEN #" & Format(Me.txCalcFrom, "Medium Date") & "# AND #" ...

Dates supplied in the #...# format must be in month/day/year order,
>regardless of your regional settings<. So you should really change "Medium
Date" to "mm/dd/yyyy" in the code above. Some people say to use
"mm\/dd\/yyyy", which is even safer.

HTH,
TC

"Ian Bayly" <ianbayly@paradise.net.nz> wrote in message
news:O$FNl5LMEHA.128@TK2MSFTNGP09.phx.gbl...
> I keep a hierachy of backups of a project.
> My most recent copy fails at line 300 in the code below, with the message
> "Enter Parameter" with parameter "value "DateSelect":
> No changes have been made to this form and prior copies still run this
code
> OK.
>
> Any ideas what I could have done. Unfortunately I am 6 hours into changes
> which I don't want to redo!
>
> All help appreciated
>
> Ian B
>
> 210: Select Case obSelection
> Case 1
> 230: sFilter = "EntrySourceCode = '" & Me.comboType & "'"
> 240: Case 2
> 250: sFilter = "RefNum = '" & Me.txID & "'"
> 260: Case 3
> 270: sFilter = "EntrySourceCode = '" & Me.comboType & "' AND
> RefNum = '" & Me.txID & "'"
> 280: End Select
> 290: sFilter = sFilter & " AND (DateSelect BETWEEN #" &
> Format(Me.txCalcFrom, "Medium Date") & "# AND #" & Format(Me.txCalcTo,
> "Medium Date") & "#)"
> 300: DoCmd.OpenForm "frmLogView", acFormDS, , sFilter, acFormReadOnly
>
>



Relevant Pages

  • Re: I have a question
    ... trouble near the heavy location is the banker that summons on board. ... sour delight very automatically? ... lower philosophers will scatter somewhere prior to ears. ...
    (sci.crypt)
  • Re: Reinstall. what with all those programs etc.
    ... Yeah i know, i purposly deleted many registry files, and than done a ... Exactly the kind of thing likely to get you into more trouble. ... the system so it's wise to make a fresh reinstall. ... I'll make a disk clone and format the drive. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Trouble opening Word 5.x in Office X or Office 2004
    ... Ensure "Track Changes" is turned OFF (look up in the Help if you do not ... It will save the document in an "Open" file format that can be read by ... >>> All of the files I have trouble with have the filetype WDBN, ... >> Daiya Mitchell, MVP Mac/Word ...
    (microsoft.public.mac.office.word)
  • Re: Ive proved Einstein Wring. What Happens Now?
    ... saving it in any format on previous occasions. ... article in microsoft wordpad then copied it into OpenOffice Writer. ... I have no trouble saving other articles written in open office in any of the ...
    (sci.physics.relativity)
  • RE: DateAdd Funtion Nightmare
    ... The first one uses the current date and 3 months prior as criteria. ... "Cortney" wrote: ... with my date format but not sure. ... it also doesn't explain why the average query still ...
    (microsoft.public.access.queries)