Building power pivot table that is connected to SQL Server 2017. In Edit Table Properties I have the following query:
Master_Accounts.Account_Type_2
,Transaction_Table.Transaction_Type
,Transaction_Table.Description
,Transaction_Table.Date_of_Transaction
,Transaction_Table.Time_of_Transaction
,Transaction_Table.Location_Id
,Revenue=Transaction_Table.Extension
,Transaction_Table.Sku
,Transaction_Table.ArAmt
,Transaction_Table.Balls
,Year=DatePart("yyyy",Transaction_Table.Date_of_Transaction)
,MonthNo=Month(Transaction_Table.Date_of_Transaction)
,Quarter=DATEPART("q", Transaction_Table.Date_of_Transaction)
,DayofMonthNo=Day(Transaction_Table.Date_of_Transaction)
,Hour=Hour(Transaction_Table.Time_of_Transaction)
,WeekNo=WeekNum(Transaction_Table.Date_of_Transaction)
FROM
Master_Accounts
INNER JOIN Transaction_Table
ON Master_Accounts.Master_ID = Transaction_Table.Account_Number
Everything work fine till I add the last 2 lines, Hour and WeehNum. I get a msg that state
"Hour is not a recognized function". The field in () is a DateTime data type. I even upgraded to SQL Server 2017 to see if that
would make a difference. It did not.
Hope I posted in right spot
Thanks