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
 General SQL Server Forums
 New to SQL Server Programming
 display records for this week

Author  Topic 

vidhya
Posting Yak Master

108 Posts

Posted - 2008-04-15 : 07:48:38
hi friends,

how to display the records for this week?

for today i used this query to dispaly the values

select count(*) from tbl_voting v,tbl_lkvotefor l where v.voteforid=l.voteforid and v.creationdatetime=CONVERT(VARCHAR(10), GETDATE(), 101)

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-15 : 08:01:57
Is your week monday to sunday?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

vidhya
Posting Yak Master

108 Posts

Posted - 2008-04-15 : 08:04:38
today is tuesday. i need monday & tuesday records to display
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-15 : 08:14:57
[code]SELECT *
FROM Table1
WHERE Col1 >= DATEADD(WEEK, DATEDIFF(WEEK, '19000101', GETDATE()), '19000101')
AND Col1 < DATEADD(WEEK, DATEDIFF(WEEK, '19000101', GETDATE()), '19000108')[/code]


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

vidhya
Posting Yak Master

108 Posts

Posted - 2008-04-15 : 08:31:13
thanks its working fine
Go to Top of Page
   

- Advertisement -