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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
criteria and dates
Hello to all,
-- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200509/1 |
#2
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |