Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft SQL Server > Re: Finding "mi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 6 Topic 10961 of 11409
Post > Topic >>

Re: Finding "missing" rows

by --CELKO-- <jcelko212@[EMAIL PROTECTED] > Apr 14, 2008 at 07:37 AM

Build a look up table of "hhmm" strings (6 periods * 24 hours = 144
rows) then create a query for a given day like this:

SELECT @[EMAIL PROTECTED]
 + T.probe_time
  FROM TimeSlots AS T
 WHERE @[EMAIL PROTECTED]
 + T.probe_time
        NOT IN (SELECT P.probe_time FROM ProbeReadings);

Acutally, an entire year of strings would be only (365 days * 144
slots) = 52560 rows, so you could put this in a VIEW and be ahead of
the game.
 




 6 Posts in Topic:
Finding "missing" rows
maury <maurizio.albert  2008-04-14 03:28:20 
Re: Finding "missing" rows
"Anith Sen" <  2008-04-14 09:28:52 
Re: Finding "missing" rows
--CELKO-- <jcelko212@[  2008-04-14 07:37:07 
Re: Finding "missing" rows
maury <maurizio.albert  2008-04-15 09:34:51 
Re: Finding "missing" rows
--CELKO-- <jcelko212@[  2008-04-15 10:29:26 
Re: Finding "missing" rows
maury <maurizio.albert  2008-04-16 04:06:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 7 0:53:33 CDT 2008.