Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 stored procedure for Time comparision

Author  Topic 

chander_2580
Yak Posting Veteran

76 Posts

Posted - 2007-06-12 : 14:16:29
Hi Gurus

Please help me in creating a stored procedure by which i can get records before the time of given records.
Actually i have a database that record a weather conditions of the specific state and in this database i have a column with date&time datatype,from this column i have retrive records that are 10 min,3hr and 12hr before the conditional record i.e like at 4 pm the weather condition is 30& 20 degree, i wanna know the weather condition before 4pm (3:50pm),before 3hrs (1:00pm) and before 12hr (4:00am).
Please help me to come out of this problem if u guys need more info abt the senario please let me know .

thanks 7 regards
Chander

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-06-12 : 14:19:56
Please give us more specifics, such as your table structure and some sample data and exactly what you'd like returned.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-06-12 : 15:27:12
moved from script library.

script library is for posting working scripts.
next time please post in the proper forum.
thank you.


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page
   

- Advertisement -