9 Replies Latest reply on May 31, 2007 10:19 AM by Newsgroup_User

    Using a column name in a where statement

    Level 7
      I am attempting to refine down a date field to just the year to match it up
      with an argument, but it is coming up as an error.

      I tried:
      WHERE #DateFormat(datePosted, 'yyyy')#

      But it keeps telling me that the variable 'datePosted' is undefined

      I know the query works, but its attempting to refine the output result is
      giving me a problem. The query is:

      SELECT docId, title, docName, format, datePosted, category
      FROM AlumniDocuments
      WHERE #DateFormat(datePosted, 'yyyy')# = #arguments.year# AND CatOrder =
      1
      ORDER by title DESC

      Thanks for any help.,