Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

smalldatetime format Expand / Collapse
Author
Message
Posted Wednesday, May 19, 2010 3:21 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, September 21, 2016 10:42 AM
Points: 916, Visits: 1,303
Hi,

I have databases where i have to insert a date value with the format:

format (now, "yyyy-mm-dd hh:mm:ss")

Other databases i have to insert a date format like this:

format (now, "dd-mm-yyyy hh:mm:ss")


Can someone explain why?


Thank you
Post #924137
Posted Wednesday, May 19, 2010 3:26 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 9:04 AM
Points: 1,517, Visits: 3,359
It may be because the collation of the databases are different, one being say UK one being US, and the date is being entered not by a date field but by a text field so it needs to be formatted in the correct date format for the database. If the value was being inserted as a date correctly then the collation shouldn't make a difference, the database should handle it.

Facts are stubborn things, but statistics are more pliable - Mark Twain
Carolyn
SQLServerSpecialists
Post #924142
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse