Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Missing Hours
Message
From
02/03/2019 04:11:44
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Missing Hours
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 10
Network:
Windows Server 2008 R2
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01666883
Message ID:
01666883
Views:
63
Sir while using SQLSERVER 2012, I have these codes
SELECT hrs,Max(reading)as reading
FROM   bin1
WHERE (CONVERT(VARCHAR(10), date, 103) = CONVERT(VARCHAR(10), GETDATE(), 103))
 AND (hrs IS NOT NULL) and updown=0 and tik is null
group by hrs
union
SELECT hrs,max(reading)as reading
FROM   bin1_empty
WHERE (CONVERT(VARCHAR(10), date, 103) = CONVERT(VARCHAR(10), GETDATE(), 103))
 AND (hrs IS NOT NULL)
group by hrs
order by hrs
It display following result


But I want to get this result


Hours from 0 to 23
Missed hours must have value 0

Please
Next
Reply
Map
View

Click here to load this message in the networking platform