Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a table

VRS_DEVICEID          VRS_UTCTIME                    VRS_SPEED    VRS_LOCATION
-------------          -----------                    ---------    -------------

 ST0001                2012-07-02 10:59:26.000        0.36         attigal
 ST0001                2012-07-02 11:33:36.000        40           tvm
 ST0001                2012-09-06 18:45:29.000        0.26         malappuram
 ST0001                2012-09-06 19:46:28.000        0.36         kozhikode
 ST0001                2012-10-09 12:10:12.000        50           idukki
 ST0001                2012-10-09 01:12:12.000        40           vayanadu


from this table how to retrieve a data as show below ,


VRS_DEVICEID          VRS_UTCTIME                    VRS_SPEED    VRS_LOCATION
 -------------          -----------                    ---------    -------------
 
  ST0001                2012-07-02                     0.36         attigal
  ST0001                2012-07-02                     40           tvm
  ST0001                2012-09-06                     0.26         malappuram
  ST0001                2012-09-06                     0.36         kozhikode
  ST0001                2012-10-09                     50           idukki
  ST0001                2012-10-09                     40           vayanadu


That is, remove the time part of column VRS_UTCTIME?

PLZ HELP....


THANKS..
Posted
Updated 18-Nov-12 17:59pm
v2

This is what I usually do:

SQL
SELECT VRS_DEVICEID, CONVERT(VARCHAR(10), VRS_UTCTIME, 121) AS VRS_UTCDATE, VRS_SPEED, VRS_LOCATION
FROM Table1
 
Share this answer
 
Comments
hasbina 19-Nov-12 0:07am    
hI Andrew Cherednik2,

YA...got it..Thank you sooooo much...
use select (col1,col2,col3,....) from VRS_DEVICEID VRS_UTCTIME VRS_SPEED VRS_LOCATION

here remove datetime column from select statement.
 
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