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  

criteria and dates



 
 
Thread Tools Display Modes
  #1  
Old September 13th, 2005, 08:14 PM
kryszystof via AccessMonster.com
external usenet poster
 
Posts: n/a
Default criteria and dates

Hello to all,


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200509/1
  #2  
Old September 13th, 2005, 08:20 PM
kryszystof via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

Sorry,

i have a query, and i want to create an expression that depends on a date
field.


i have

Field1 | Field2
Date Expr

field 2is such: adj1: iif([DateField] = "01/01/2002",[do calculation], " ")

i think it has to do with the date format that i am searching by, or possibly
syntax?

TIA,
~K

kryszystof wrote:
Hello to all,



--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200509/1
  #3  
Old September 13th, 2005, 08:23 PM
kryszystof via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

wow!, I fixed my problem myself!

thanks to anyone who might have wrote back!

(i removed quotes~ works like charm)
kryszystof wrote:
Sorry,

i have a query, and i want to create an expression that depends on a date
field.

i have

Field1 | Field2
Date Expr

field 2is such: adj1: iif([DateField] = "01/01/2002",[do calculation], " ")

i think it has to do with the date format that i am searching by, or possibly
syntax?

TIA,
~K

Hello to all,



--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200509/1
  #4  
Old September 13th, 2005, 08:24 PM
kryszystof via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

Nevermind, I still need help!

more ways than one! lol

kryszystof wrote:
wow!, I fixed my problem myself!

thanks to anyone who might have wrote back!

(i removed quotes~ works like charm)
Sorry,

[quoted text clipped - 15 lines]

Hello to all,



--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200509/1
  #5  
Old September 13th, 2005, 09:18 PM
Chaim
external usenet poster
 
Posts: n/a
Default

Assuming that [DateField] is in fact of type DateTime, then you need to
place the literal date between #...# as in:

IIf (([DateField] = #01/01/2002#, [do calculation], " ")

Good Luck!
--

Chaim


"kryszystof via AccessMonster.com" wrote in
message ...
Nevermind, I still need help!

more ways than one! lol

kryszystof wrote:
wow!, I fixed my problem myself!

thanks to anyone who might have wrote back!

(i removed quotes~ works like charm)
Sorry,

[quoted text clipped - 15 lines]

Hello to all,



--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200509/1



  #6  
Old September 13th, 2005, 09:25 PM
Marshall Barton
external usenet poster
 
Posts: n/a
Default

kryszystof via AccessMonster.com wrote:
i have a query, and i want to create an expression that depends on a date
field.

i have

Field1 | Field2
Date Expr

field 2is such: adj1: iif([DateField] = "01/01/2002",[do calculation], " ")

i think it has to do with the date format that i am searching by, or possibly
syntax?



Date values (as opposed to text strings) need to be enclosed
in # characters. In addition, you probably do not really
want to evaluate to a space character, or even a zero length
string when the date is before 1/1/02. I can't be sure from
your expression, but I think you want to use:

adj1: IIf([DateField] = #1/1/2002#, [do calculation], Null)

--
Marsh
MVP [MS Access]
  #7  
Old September 13th, 2005, 09:47 PM
kryszystof via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

THANK YOU EVER SO MUCH!

I have been beating my on my desk all afternoon!

I did (at one time) know about the '#' seperator, but forgot.

Thanks again,
~K

Marshall Barton wrote:
i have a query, and i want to create an expression that depends on a date
field.

[quoted text clipped - 8 lines]
i think it has to do with the date format that i am searching by, or possibly
syntax?


Date values (as opposed to text strings) need to be enclosed
in # characters. In addition, you probably do not really
want to evaluate to a space character, or even a zero length
string when the date is before 1/1/02. I can't be sure from
your expression, but I think you want to use:

adj1: IIf([DateField] = #1/1/2002#, [do calculation], Null)



--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200509/1
  #8  
Old September 14th, 2005, 04:37 AM
Van T. Dinh
external usenet poster
 
Posts: n/a
Default

Just in case you forgot, the explicit date must be in the format
"mm/dd/yyyy" and enclosed in hashes (#) regardless of your regional settings
for dates.

Alternatively, you can use an internationally unambiguous format like
"yyyy-mm-dd" with hashes.

--
HTH
Van T. Dinh
MVP (Access)




"kryszystof via AccessMonster.com" wrote in
message ...
THANK YOU EVER SO MUCH!

I have been beating my on my desk all afternoon!

I did (at one time) know about the '#' seperator, but forgot.

Thanks again,
~K

Marshall Barton wrote:
i have a query, and i want to create an expression that depends on a date
field.

[quoted text clipped - 8 lines]
i think it has to do with the date format that i am searching by, or
possibly
syntax?


Date values (as opposed to text strings) need to be enclosed
in # characters. In addition, you probably do not really
want to evaluate to a space character, or even a zero length
string when the date is before 1/1/02. I can't be sure from
your expression, but I think you want to use:

adj1: IIf([DateField] = #1/1/2002#, [do calculation], Null)



--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200509/1



 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Use query criteria for calculated dates Carol Running & Setting Up Queries 1 June 28th, 2005 11:35 PM
Multiple dates in Criteria section tuhoegirl Running & Setting Up Queries 2 June 21st, 2005 05:40 AM
utilizing Between Dates of query criteria in title of report Jorie Setting Up & Running Reports 1 December 29th, 2004 09:06 PM
DCOUNT criteria with dates Bill Running & Setting Up Queries 11 December 10th, 2004 12:04 AM
Query using BETWEEN and Dates as criteria Chuck Running & Setting Up Queries 1 November 29th, 2004 01:18 AM


All times are GMT +1. The time now is 02:03 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.