Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have a table from a query:
select employeeId, hours, intime from DW.dbo.payrollstuff
I have a Date Table defined as:
Solved! Go to Solution.
Hi @feelie75
I was just reading your last paragraph and you are mentioning Datetime columns. If the time portion is required, you'll have to make a copy of that column and change the copy to a type of Date to use in the relationship.
The reason for this is the relationship to the date table would only match columns with 00:00:00 since they would match the date column in the date table. (Columns with a time portion other than 00:00:00 wouldn't match in the relationship.)
I hope this makes sense.
Yep, that was the secret sauce, gmsamborn! I just changed my SQL query to: cast(intime as Date), and then it was able to match.
I didn't know that a relationship between two tables ignored the "Formatting" when I changed it to Date. That apparently ONLY changes the formatting, but the data itself still remained date/time, so the join was only happening on the 00:00:00 payroll entries.
Changing the query to cast the value as date forced ALL entries to have 00:00:00 as their time component, and thus the relationship join now works!
Or changing the type in the column to Date as you recommended would also work. Thanks for leading me down and confirming that. Cheers!
Glad that helped. (I've seen that more than a couple of times.)
Hi @feelie75
I was just reading your last paragraph and you are mentioning Datetime columns. If the time portion is required, you'll have to make a copy of that column and change the copy to a type of Date to use in the relationship.
The reason for this is the relationship to the date table would only match columns with 00:00:00 since they would match the date column in the date table. (Columns with a time portion other than 00:00:00 wouldn't match in the relationship.)
I hope this makes sense.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |