July 11, 2008 at 1:14 am
Hi
I am developing application using windows mobile 6 with vc++ and SQL CE 3.1
I have used query for getting yesterday date entry ..I am doing minus 1 from system date
and getting result. but the problem is that when the system date is 1st day of month or year.this query is not working.
so is there any other logic
hope for reply.
thanx
subodh
July 11, 2008 at 1:54 am
Could you post the query that you are using?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 13, 2008 at 3:57 am
Could u post your Query then i will reply
July 14, 2008 at 1:18 am
try this query,it works for me
select * from testdate where datepart(dd,date1)=datepart(dd,getdate())-1
so ,i hope this work for you
July 14, 2008 at 5:23 am
I think this is what you need however without further info I cannot be sure:
SELECT
*
FROM
sometable
WHERE
somedatecolumn >= dateadd(dd,datediff(dd,0,getdate()),-1)
AND
somedatecolumn < dateadd(dd,datediff(dd,0,getdate()),0)
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply