Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUBSTR & TIMESTAMP

Status
Not open for further replies.

rani80

Technical User
Nov 29, 2004
4
US
Is it possible just to update the date in the timestap field?

SELECT SUBSTR(TIMESTAMP,1,8)
FROM TABLE

That does not work.
 
This will work assuming that the TimeStamp column is DateTime or SmallDateTime.
Code:
select convert(varchar(10), TimeStamp, 101)
from TAble

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
Donate to Katrina relief
 
Doesn't seem to be working for me...

SQLCODE = -104, ERROR: ILLEGAL SYMBOL "CONVERT". SOME SYMBOLS THAT
MIGHT BE LEGAL ARE: + -
SQLSTATE = 42601 SQLSTATE RETURN CODE
 
Read mrdenny's original post. CONVERT will only work on a datetime or smalldatetime. If the column is a timestamp it will not work.
 
** sniff sniff **

DB2?

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
To borrow vongrunt's comment:

**sniff sniff**

Could you be posting an ORACLE question in the Microsoft SQL Server forum???

-SQLBill

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top