How to run a query that only uses the year portion of a General Date?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tim Mullin
    New Member
    • Aug 2010
    • 48

    How to run a query that only uses the year portion of a General Date?

    Hello All,

    I have a field on a form that is formatted as a general date and would like to be able to run a query that returns items that have end dates that end in a specific year.

    I have a combobox that has years entered as values (not linked to a table) (2010, 2011,etc...)

    However when I simply set the end date column criteria to match the combobox selection, nothing is returned. I'm assuming this is because the combobox only has a year value while the end date field has a full date.

    Is there a way I can format the combobox or change the expression in the query to allow me to return items based on only a portion of the date?

    Any help would be greatly appreciated! Thanks!
  • Tim Mullin
    New Member
    • Aug 2010
    • 48

    #2
    I was able to figure it out after some research on the net! Thanks anyways though!

    Comment

    • tuxalot
      New Member
      • Feb 2009
      • 200

      #3
      Hi Tim,

      Care to share your solution with us?

      Comment

      • mshmyob
        Recognized Expert Contributor
        • Jan 2008
        • 903

        #4
        Very easy Tux. Just use the YEAR function on the End Date field in the table and match it to the value from the combo box.

        cheers,

        Comment

        • tuxalot
          New Member
          • Feb 2009
          • 200

          #5
          nice tip. Thanks

          Comment

          Working...