Hi
I have the expression below which seeks to get certain fields from a table where the date is between the two dates in the expression. However, there is something wrong with the statement - what is it?
Thank YOu
Allister
The code is
let
Source = GetConsolidatedSQLData("Select accountcode, branchcode, departmentcode, transactiondate, transactionamount, periodno, yearno, periodid from GLTRAN where transactiondate between '1/7/2018 00:00:00' and '2/7/2018 00:00:00'"),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"AccountCode", type text}, {"BranchCode", type text}, {"DepartmentCode", type text}, {"PeriodNo", type text}, {"YearNo", type text}, {"PeriodID", type text}, {"CompanyCode", type text}, {"TransactionAmount", Currency.Type}, {"TransactionDate", type date}})
in
#"Changed Type"
the error I get is
An error occurred in the ?GetSQLData? query. DataSource.Error: Web.Contents failed to get contents from 'http://Company('NLD')/ExecuteSql('Select%20accountcode,%20branchcode,%20departmentcode,%20transactiondate,%20transactionamount,%20periodno,%20yearno,%20periodid%20from%20GLTRAN%20where%20transactiondate%20between%20'1/7/2018%2000:00:00'%20and%20'2/7/2018%2000:00:00'')' (400): Bad Request
Details:
DataSourceKind=Web
DataSourcePath=http://Company('NLD')/ExecuteSql('Select%20accountcode,%20branchcode,%20departmentcode,%20transactiondate,%20transactionamount,%20periodno,%20yearno,%20periodid%20from%20GLTRAN%20where%20transactiondate%20between%20'1/7/2018%2000:00:00'%20and%20'2/7/2018%2000:00:00'')
Url=http://Company('NLD')/ExecuteSql('Select%20accountcode,%20branchcode,%20departmentcode,%20transactiondate,%20transactionamount,%20periodno,%20yearno,%20periodid%20from%20GLTRAN%20where%20transactiondate%20between%20'1/7/2018%2000:00:00'%20and%20'2/7/2018%2000:00:00'')
Bookmarks