Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
hungleon88
Starting Member
16 Posts |
Posted - 2008-09-17 : 14:52:01
|
| Hi everybody, I have a trouble with datetime type.when i insert record from java application, the column Date always have a record like this : Sep 18 2008 12:00 AMIt's always 12:00 AM.It's cannot get the current time(Month, Day, year are right).Can you guys hint me solve this??Thanks! |
|
|
mcrowley
Aged Yak Warrior
771 Posts |
Posted - 2008-09-17 : 14:54:28
|
| Try inserting the function getdate(). |
 |
|
|
hungleon88
Starting Member
16 Posts |
Posted - 2008-09-17 : 15:03:42
|
| but getDate() cannot get the time.It only get Month,Day and year... |
 |
|
|
mcrowley
Aged Yak Warrior
771 Posts |
Posted - 2008-09-17 : 15:45:27
|
I see you have already tried this?select getdate() |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-09-17 : 16:06:31
|
quote: Originally posted by hungleon88 but getDate() cannot get the time.It only get Month,Day and year...
GETDATE() provides the time. If you aren't seeing the time, then you've got an application bug.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
|
lepeniotis
Yak Posting Veteran
75 Posts |
Posted - 2008-09-18 : 04:15:22
|
| Hey try thiscast(getdate() as VARCHAR(20))It works for me!!Let me know if that helped. RegardsMSc Advanced Computing Science MSc Database ProfessionalSheffield Hallam UniversityMCP (70-229, 70-228)Industrial IT Engineer |
 |
|
|
|
|
|