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)
 dates

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-06-27 : 09:19:53
tina Nguyen writes "I'm using macromedia to develop a web page. This is my sql statement to select multiple fields from the database. I can't make a selection for Weekdate. Please help



SELECT MGMT_SVR, CREATE_DATE, HITS, MESSAGE_ID, Severity, ASE, BARSQ, RESP_MGR, dateadd(d,-(datepart(dw,CREATE_DATE)-1),CREATE_DATE) as Weekdate
FROM dbo.v_TophittersAll
WHERE ASE like 'varASE' AND MGMT_SVR like 'varMGMT' AND BARSQ like 'varBARSQ' AND Severity like 'varSeverity' AND dateadd(d,-(datepart(dw,CREATE_DATE)-1),CREATE_DATE) /* Weekdate */ like 'varWeekdate'"

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2002-06-27 : 09:52:12
Is this your actual SQL statement?

If so then AND dateadd(d,-(datepart(dw,CREATE_DATE)-1),CREATE_DATE) /* Weekdate */ like 'varWeekdate'" will not work...

but AND dateadd(d,-(datepart(dw,CREATE_DATE)-1),CREATE_DATE) like '27/06/2002'

might do what you want...

Are you sure this is what you are after... run this select dateadd(d,-(datepart(dw,GetDate())-1),GetDate()) in QA and see if the answer is what you are expecting...

Peace

Rick

Go to Top of Page
   

- Advertisement -