Documents indicate that I should be able to use the DateFormat() function to format inside of a QoQ, But I am getting an error - I have tried cast() in addition to normal... I would like to return a query with date parts broken out (month and year) or filter based on datepart to pull back only record that match a month and year
So my objective would look like this in a normal Query.
SELECT
name
,date AS fulldate
,month(date) AS month
,year(date) as year
OR
WHERE
month(date) = arguments.month
and year(date) = arguments.year
However when I try to effectively do this in QoQ - I get a weird error.
Here is what I've tried:
SELECT
directory + '\' + name AS fullpath ,
size ,
DateLastModified ,
dateformat(DateLastModified) AS month
FROM getAllFiles
ORDER BY DateLastModified
Here is the error
Query Of Queries syntax error.
Encountered "(. Incorrect Select Statement, Expecting a 'FROM', but encountered '(' instead, A select statement should have a 'FROM' construct.
I have also tried this (and got the same error)
SELECT
directory + '\' + name AS fullpath ,
size ,
DateLastModified ,
cast( dateformat(DateLastModified,'mm-dd-yyyy') as date ) AS month
FROM getAllFiles ORDER BY DateLastModified
Help greatly appreciated Cheers