Click here to Skip to main content
16,012,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
using sql qurey how to less one minute in 01:40 pm retrun value get in same formatt
is like 01:39pm

pls help me

regards
pavan
Posted

1 solution

Can you have a look at this.

SQL
SELECT SUBSTRING(CONVERT(VARCHAR, DATEADD(MINUTE,-1,GETDATE()), 22),9,6) + ' ' + SUBSTRING(CONVERT(VARCHAR, DATEADD(MINUTE,-1,GETDATE()), 22),19,2) AS Currenttime


Hope this will help you.

Cheers....
 
Share this answer
 
Comments
Toniyo Jackson 4-Aug-11 7:18am    
Correct. My 5
arindamrudra 4-Aug-11 7:24am    
Thanks a lot.
onpavan 4-Aug-11 7:19am    
thanks for giving
arindamrudra 4-Aug-11 7:23am    
You are welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900