I try to concatenate id and date to populate in dropdown.
select VisitID as Value, Convert(nvarchar(50),VisitID)+' - '+Convert(nvarchar(50),VisitDate) as Text
from Visit
above query work for me to concatenate but the result is in the form of '21 - Feb 13 2013 12:00AM'
i want the result should be in form of '21 - 02/13/2012'
what I need to do?
Use CONVERT and supply third parameter for date and time styles.
Try this:
select VisitID as Value, Convert(nvarchar(50),VisitID)+' - '+Convert(nvarchar(50),VisitDate, 101) as Text
from Visit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With