A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

What is wrong with this WHERE clause ?



 
 
Thread Tools Display Modes
  #1  
Old May 28th, 2004, 11:46 PM
David
external usenet poster
 
Posts: n/a
Default What is wrong with this WHERE clause ?

WHERE CloseDate is not Null AND
CloseDate Between "#" & Format$(varStart(), 'mm/dd/yyyy hh:nn:ss AM/PM') & "# And #" & Format$(varEnd(), 'mm/dd/yyyy hh:nn:ss AM/PM') & "#"
  #2  
Old May 29th, 2004, 12:21 AM
Ken Snell
external usenet poster
 
Posts: n/a
Default What is wrong with this WHERE clause ?

Assuming that varStart and varEnd are public functions that exist in your
database, this statement looks ok.

So, can you tell us what error you're getting? Kinda hard to help if we
don't know why you (or ACCESS) think it's wrong.

--
Ken Snell
MS ACCESS MVP

"David" wrote in message
...
WHERE CloseDate is not Null AND
CloseDate Between "#" & Format$(varStart(), 'mm/dd/yyyy hh:nn:ss AM/PM') &

"# And #" & Format$(varEnd(), 'mm/dd/yyyy hh:nn:ss AM/PM') & "#"


  #3  
Old May 29th, 2004, 03:01 AM
Van T. Dinh
external usenet poster
 
Posts: n/a
Default What is wrong with this WHERE clause ?

The first condition (CloseDate is not Null) is NOT necessary. If CloseDate
is Null, the 2nd condition will return Null which will be treated as not
True and therefore not selected.

That is not "wrong", though. If the varStart() and varEnd() are Public
functions that return Null or Date values, the WHERE clause looks OK
(provided that the Query is executed in Access).

You will have to tell us the symptoms of "what's wrong".

--
HTH
Van T. Dinh
MVP (Access)



"David" wrote in message
...
WHERE CloseDate is not Null AND
CloseDate Between "#" & Format$(varStart(), 'mm/dd/yyyy hh:nn:ss AM/PM') &

"# And #" & Format$(varEnd(), 'mm/dd/yyyy hh:nn:ss AM/PM') & "#"


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:09 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.