Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends

with the help of inner join,i joined two table like that
SQL
select SR.amountpaid,SR.date,S.name from SupplierRecord as SR inner join Supplier as S on SR.Supplierid=S.Supplierid where Purchaseid ='0'

in this joining i get a date with time like below

amountpaid date name
1000 2013-01-21 12:30:18.000 Vishal
2000 2013-01-22 10:29:41.000 A Mandlekar

but i want a only date (ie.2013-01-21 ) will be come not datewithtime (2013-01-21 12:30:18.000).

so can you please help me.

thnx in advance.
Posted
Updated 22-Jan-13 2:35am
v3

1 solution

You need to use the CONVERT function with format 23: http://www.sqlusa.com/bestpractices2005/centurydateformat/[^]

SQL
select 
  SR.amountpaid,
  convert(varchar, SR.date, 23),
  S.name 
from SupplierRecord as SR 
inner join Supplier as S on SR.Supplierid=S.Supplierid 
where Purchaseid ='0'
 
Share this answer
 

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