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 2000 Forums
 SQL Server Development (2000)
 Searching for time

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-10-14 : 08:14:09
Vic writes "Hello

I need to have a query search for records that are time stamped 30 minutes earlier than the current system time.

here is the query I am using

SELECT item_id,item_desc,sum(print_quantity) as qty
FROM dbo.pathguide_pick_ticket_view
WHERE (print_date >= GETDATE() - 1) AND (location_id = 100004) AND (last_maintained_by = 'amazon_picks') OR
(last_maintained_by = 'ecomm_picks')
group by item_id ,item_desc
order by item_id asc

I am using this query in a VB6 program the will print a report of things printed in the last 30 min.

Ideally I would like to pass a variable to set the time to diffrent intervals.

I just need to know how to parse the date out

thanks
Vic"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-14 : 08:17:51
Similar post here
http://sqlteam.com/forums/topic.asp?TOPIC_ID=56416

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -