Results 1 to 2 of 2

Thread: A Little Help With this Query

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2007
    Posts
    197

    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

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,206

    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
  •  



Click Here to Expand Forum to Full Width