|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have a query where an item is linked to two different dates.
I want the query to return whichever date is the larger. I've tried this to no avail: Date: IIF([Date 1] > [Date 2], [Date 1], [Date 2]) But I just get #ERROR returned. Any suggestions? Thanks in advance for any help. |
|
#2
|
|||
|
|||
|
Your syntax looks okay as you have it written...where are you using this? It looks like an expression (field) for a query. Or are you trying to use this as the actual criteria for a query? Is Date 1 and Date 2 parameters or fields in your table(s). You stated you get #Error returned...where is this displayed? You might post the sql of your query and I can better understand what you are trying to do.
lwells |
|
#3
|
|||
|
|||
|
That is what I entered in the Design View of a query.
[Date 1] and [Date 2] are two fields in the same database table. I'm attempting to get this one field in the query to return whichever date is larger. The query still runs, but the column with that forumula is filled with #ERROR. UPDATE: Problem solved. The code worked, but one of the date fields wasn't properly converted to date type values which was causing the comparison to break. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Choosing a date to return |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|