|
-
Feb 2nd, 2012, 04:24 AM
#1
Thread Starter
Addicted Member
A Little Help With this Query
Hi
I am in access and am trying to update a column and for each row I am checking various date values in order to set the appropriate value.
I Seem to have worked through all of the column values i need to set bar one, for this condition it is required that DateValueA should be larger than or equal to the month after DateValueB. Now in this instance I decided that DateValueB's and DateValueA's Month values could be extracted and compared but then I also checked the year part as well. I had to make sure YearA was equal to or larger than YearB and also monthB was 1 month later.
however when comparing date parts these are then in number format so if I compare 01/01/2012 with 31/12/2011 year and month parts it will fail because even thought the year is larger and the month is larger - datewise speaking - it will still fail and not recongnise this as a later date.
How would you be able to determine that 1 is larger than 12 in other words not in number but in date format?
Thanks
G
-
Feb 2nd, 2012, 01:00 PM
#2
Re: A Little Help With this Query
Check the year first, if the year is larger then there's no need to check the month. I think you've posted this in the wrong forum, what does this have to do with reporting?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|