Skip to main content
Inspiring
May 10, 2007
Question

Using Day or DayOfWeek in queries

  • May 10, 2007
  • 2 replies
  • 270 views
I am trying to query a query and pull data related to a specific day of the week. I find I can use the Day and DayOfWeek functions in the original query, if I want multiple queries, but they do not work in a query of a query. My goal is to run the main query against the database once, then run seperate queries against that query for each day of the week. But, I get this error:

Encountered "(RecordDate) =. Incorrect conditional expression, Expected one of [like|null|bewteen|in|comparison] condition, Unrecognized comparision operator.

Recorddate is a field in the database. As I said, this works fine in a database query, just not a query of a query. Any ideas why and how to get around it?
    This topic has been closed for replies.

    2 replies

    Inspiring
    May 10, 2007
    Many db's have functions that allow you to select the day of the week, either as a number or string.
    Participating Frequently
    May 10, 2007
    Q-of-Q is not a complete implementation of SQL and only allows certain aggregate functions, conditional operators, and the like. You probably should select your DayOfWeek value as an additional column in your original query where this function does work.

    Phil