Click here to Skip to main content
12,451,425 members (53,932 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: SQL
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 18-Nov-12 17:53pm
hasbina1.4K
Updated 18-Nov-12 17:59pm
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

This is what I usually do:

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

YA...got it..Thank you sooooo much...
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

use select (col1,col2,col3,....) from VRS_DEVICEID VRS_UTCTIME VRS_SPEED VRS_LOCATION

here remove datetime column from select statement.
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160826.1 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100