Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Missing Hours
Message
De
02/03/2019 04:11:44
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Missing Hours
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 10
Network:
Windows Server 2008 R2
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01666883
Message ID:
01666883
Vues:
64
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform