Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I need help extracting a year from a short date format field in a query. I thought typing:

    Year([SaleDate])

    would allow the user to type in 2008 for example to retrieve records for that year for customer sales in a parameter prompt box..., but it's not prompting me for anything.

    Could you please help ASAP
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  2. #2
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    South Carolina, USA
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In your query, I would create a field called year....year:right([nameofdatefield],2) to pull out the 2 digit year.
    Then prompt the user to enter the year...[Enter 2 digit year] in the criteria field.

    HTH....

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [code][quote name='DeborahP' post='769722' date='08-Apr-2009 11:26']In your query, I would create a field called year....year:right([nameofdatefield],2) to pull out the 2 digit year.
    Then prompt the user to enter the year...[Enter 2 digit year] in the criteria field.

    HTH....[/quote]

    Thank you Deborah. I solved it while waiting...did it like you said, just didn't add the ,2 portion as it wasn't needed. Love you folks so much!
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •