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
 Working with date format

Author  Topic 

esambath
Yak Posting Veteran

89 Posts

Posted - 2009-05-26 : 03:57:30
Hi Guys,

Please help this query

this is table value

P_BidDate P_ProjectId p_projectcatid date
2009-02-22 00:00:00.000 9363479 8341603 22 Feb 2009
2009-05-08 00:00:00.000 8848808 8341603 08 May 2009
2009-05-12 00:00:00.000 6035927 8341603 12 May 2009
2009-05-08 00:00:00.000 6347695 8341603 08 May 2009
2009-05-06 00:00:00.000 6083487 8341603 06 May 2009
2009-05-05 00:00:00.000 5470570 8341603 05 May 2009
2009-05-06 00:00:00.000 5570989 8341603 06 May 2009
2009-05-05 00:00:00.000 7063659 8341603 05 May 2009
2009-05-26 00:00:00.000 2847377 8341603 26 May 2009

i want to get my expected output as "WHICH RECORD CONTAIN THE GREATER DATE OF CURRENT DATE"

I have tried this query, but i am not getting my expected output, please help me to modify my below query

select P_BidDate,P_ProjectId,p_projectcatid,
convert(varchar,P_biddate,106)[date],u_firstname+' '+U_FamilyName [buyername],
convert(varchar,P_biddate,103)[Refdate]
from MF_ProjectDetails,MF_UserMaster
where P_Userid=U_Userid and p_status<> 0 and
P_projectcatid in('8341603') and convert(varchar,P_BidDate,101)>=convert(varchar,getdate(),101)


thanks in advance

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-05-26 : 04:03:15
[code]where P_BidDate > dateadd(day, datediff(day, 0, getdate()), 0)[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

esambath
Yak Posting Veteran

89 Posts

Posted - 2009-05-26 : 05:21:13
Dear khtan,

Thanks for your response.

The query is working.

Regards
Sambath kumar



quote:
Originally posted by khtan

where P_BidDate > dateadd(day, datediff(day, 0, getdate()), 0)



KH
[spoiler]Time is always against us[/spoiler]



Go to Top of Page
   

- Advertisement -