Forum Discussion
Anonymous
6 years agoNot applicable
Convert Text to Date in Direct Query mode
Hi, I'm using DirectQuery mode for my report. I have date fields which are of the data type Text. I tried converting it into Date by changing the Data Type from Text to Date. It says "This step r...
- 6 years ago
Anonymous ,
While connecting to direct query mode you can use native query editor to transform your columns.
CONVERT(datetime, YourDatecolumn)
Don't forgrt to hit THUMBS UP and Accept this as a solution if it helps you!
Tahreem24
6 years agoSuper User
Anonymous ,
While connecting to direct query mode you can use native query editor to transform your columns.
CONVERT(datetime, YourDatecolumn)
Don't forgrt to hit THUMBS UP and Accept this as a solution if it helps you!
Anonymous
6 years agoNot applicable
Tahreem24Thank you!
For others having the same issue,
Use the following SQL command while getting data for your report:
SELECT CONVERT(date, [DateSubmitted]) as [DateSubmitted]
,DATEPART("MONTH", [DateSubmitted]) as [Month]
,DATEPART("YEAR", [DateSubmitted]) as [Year]
,(DATEPART("WEEK", [DateSubmitted]) as [Week]
,'Q' + CAST(DATEPART("QUARTER", [DateSubmitted]) as varchar) as [Quarter]
FROM..