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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert Select problem 1

Status
Not open for further replies.

randy4126

Programmer
Jun 2, 2001
62
US
I am trying to insert data into a table from another table. The problem comes in with the unix timestamp column. It always converts the the date to 0000-00-00 but if you run the select query by itself it works just fine(Gives the correct date). Could someone see what I am doing wrong. Here is my SQL statement:


Code:
Insert Into HistoryPeaksSGBW (SGID_HPSGBW, Bandwidth_HPSGBW, SDStreams_HPSGBW, HDStreams_HPSGBW, EffectiveStreams_HPSBW, TimeStamp_HPSGBW)
Select SGID_CSGBW, Bandwidth_CSGBW, SDStreams_CSGBW, HDStreams_CSGBW, EffectiveStreams_CSGBW, FROM_UNIXTIME(TimeStamp_CSGBW,'%Y-%d-%m')
from CurrentSGBW

Thanks for you help.

Randy
smiletiniest.gif
 
That was it. I didn't notice I had the order wrong. I remember reading that in the docs now. Thanks a LOT!

Randy
smiletiniest.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top