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
 Transact-SQL (2000)
 Select statement with DATEPART()

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-07-08 : 12:06:09
Voytek writes "Hi, I am trying to modyfi my exisitng view to select data, base on time it was entered. The following is a sample statement that needs to be modyfied. I have spend over 3 days trying different approach but no luck. The task is simple I need to select a data between 15:30 and 16:30 and enter that into column1 called Hour1.
(SELECT COALESCE(dPartCount,0)
FROM bizware.OEEQwithVariance
WHERE loeeworkcellid = oqwc1.loeeworkcellid AND (datepart(hh, tStart) = 15 AND datepart(mi,tStart)>= 30)) AS [Hour 1],


Is there a functiton that would let me do it in one step????

Regards"

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-07-08 : 13:24:25
Could you supply some sample data... and maybe a desired result set??

It would help loads

Corey
Go to Top of Page
   

- Advertisement -