Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 26th, 2005, 03:32 PM
databyss databyss is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 2 databyss User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 27 m 29 sec
Reputation Power: 0
Question Choosing a date to return

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.

Reply With Quote
  #2  
Old August 26th, 2005, 05:09 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
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

Reply With Quote
  #3  
Old August 27th, 2005, 01:17 PM
databyss databyss is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 2 databyss User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 27 m 29 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Choosing a date to return


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT