|
1 registered members (1 invisible),
164
guests, and 7
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Forums48
Topics103,648
Posts1,169,475
Members1,618
| |
Most Online39,516 Apr 16th, 2026
|
|
|
SQL ish help required
#1643182
05/08/2020 15:55
05/08/2020 15:55
|
elder81
Unregistered
|
elder81
Unregistered
|
Hi all,
I have written the following simple SQL and it works perfectly:
Select orgunit.shortname as 'Store', datepart(wk, schedulekpiday.dayId) as 'Week Number', schedulekpiday.DayID as 'Date', KPI.shortname, schedulekpiday.Value * 100 as 'Efficiency Score' from schedulekpiday inner join KPI on schedulekpiday.KpiId = kpi.KPIID inner join orgunit on orgunit.orgunitid = schedulekpiday.orgid where --schedulekpiday.orgId = 1533 and schedulekpiday.DAYID between '2020-08-10' and '2020-08-16'and KPI.KPIId = 244
In the software I work with we have a report writer that generates columns based on the SQL.
The report writer is getting confused when using the datepart fucntion, instead of creating one column, it create 2.
Any ideas how to stop this happening, perhaps another method of getting week number from a date that doesn't require an additional ,?
Thanks
Mark
|
|
|
Re: SQL ish help required
[Re: ]
#1643229
06/08/2020 15:25
06/08/2020 15:25
|
Joined: Dec 2005
Posts: 12,309 Sandhurst
Begbie
ex El Presidente
|
ex El Presidente
I AM a Coop
Joined: Dec 2005
Posts: 12,309
Sandhurst
|
I'm guessing the S/W is seeing the , as the separator, so would it some how be able to work this calculation out into a variable, then call the variable in the SQL query?
Your car is Usain Bolt with wellies
|
|
|
|