Forum Discussion
EaglesTony
2 years agoPost Prodigy
How do I check a column in a table in a SQL query
Hi, I currently have the following (which works): = Sql.Database("Northwest", "Reporting", [Query="SELECT DISTINCT SUBSTRING([IssueKey],1,(CHARINDEX('-', [IssueKey])-1) ) AS TeamProject#(lf)FR...
EaglesTony
2 years agoPost Prodigy
Giving me an error "Expressions.Syntax.Error: Token ']' expected.
- EaglesTony2 years agoPost Prodigy
I fixed one thing, but with this:
= Sql.Database("Northwest", "Reporting", [Query="SELECT DISTINCT SUBSTRING([IssueKey],1,(CHARINDEX('-', [IssueKey])-1) ) AS TeamProject#(lf)FROM [Reporting].[dbo].[SprintIssuesSummaryEOS] WHERE Sprint IN#(lf)(SELECT Sprint#(lf)FROM dbo.SprintDates#(lf) WHERE SprintStartDate = " & CurrentSprintInfo[PriorSprintStartDate]{0} & " and SprintEndDate = " & CurrentSprintInfo[PriorSprintEndDate]{0} & ")"])
I am getting the following error(note: CurrentSprintInfo[PriorSprintStartDate]{ and CurrentSprintInfo[PriorSprintEndDate] I converted the type to date) The SprintStartDate is in a sql table defined as datetime:
Expression.Error: We cannot apply operator & to types Text and Date. Details: Operator=& Left=SELECT DISTINCT SUBSTRING([IssueKey],1,(CHARINDEX('-', [IssueKey])-1) ) AS TeamProject FROM [Reporting].[dbo].[SprintIssuesSummaryEOS] WHERE Sprint IN (SELECT Sprint FROM dbo.SprintDates WHERE SprintStartDate = Right=3/13/2024