RE: Pulling data from 2 columns
From: Brandon Lilly (avarice_at_nospam_swbell.net)
Date: 12/28/04
- Next message: yapster: "RE: calculating Payroll"
- Previous message: Paul: "RE: Database Schema Review Templates"
- In reply to: tarheels4025: "Pulling data from 2 columns"
- Next in thread: tarheels4025: "RE: Pulling data from 2 columns"
- Reply: tarheels4025: "RE: Pulling data from 2 columns"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 28 Dec 2004 12:41:02 -0800
If you are just wanting to grab the date from one column and the time from
another, you can do something like this:
DECLARE @DateAndTime datetime
DECLARE @TimeOnly datetime
SET @DateAndTime = 'DEC 10, 2004 10:01AM'
SET @TimeOnly = '10:04AM'
SELECT CAST(CONVERT(char(8), @DateAndTime, 112) + ' ' + CONVERT(char(5),
@TimeOnly, 114) AS datetime) AS TransmissionTime
Just replace the variables in the query with your columns.
Brandon
- Next message: yapster: "RE: calculating Payroll"
- Previous message: Paul: "RE: Database Schema Review Templates"
- In reply to: tarheels4025: "Pulling data from 2 columns"
- Next in thread: tarheels4025: "RE: Pulling data from 2 columns"
- Reply: tarheels4025: "RE: Pulling data from 2 columns"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|