P
pamelafluente
Hi I have to insert dates into some Access and SQL Databases.
I need to be general as the target computer might be in any country.
--------
- For access I wrote the follow:
Function Date_ACCESS(ByVal Data As Date) As String
Return "#" & Data.Year & "-" & Data.Month & "-" & Data.Day & "
" & _
Data.Hour & ":" & Data.Minute & ":" & Data.Second
& "#"
End Function
I wish to know if this is correct or it might fail for some setting
(eg. 12 / 24 hours)
or if there is a better way to write this function. Thanks
---------
- For SQL server I am a little confused. I would like your help to
write a general function which
yields the correct date whatever is the setting of target DBMS
(possibly, some culture related info migh be a parameter, if needed).
Function Date_SQLServer(ByVal Data As Date, CultureInfo as ... ) As
String
'...
End Function
Please help. Thanks
-Pam
I need to be general as the target computer might be in any country.
--------
- For access I wrote the follow:
Function Date_ACCESS(ByVal Data As Date) As String
Return "#" & Data.Year & "-" & Data.Month & "-" & Data.Day & "
" & _
Data.Hour & ":" & Data.Minute & ":" & Data.Second
& "#"
End Function
I wish to know if this is correct or it might fail for some setting
(eg. 12 / 24 hours)
or if there is a better way to write this function. Thanks
---------
- For SQL server I am a little confused. I would like your help to
write a general function which
yields the correct date whatever is the setting of target DBMS
(possibly, some culture related info migh be a parameter, if needed).
Function Date_SQLServer(ByVal Data As Date, CultureInfo as ... ) As
String
'...
End Function
Please help. Thanks
-Pam