Click here to Skip to main content
16,011,358 members
Home / Discussions / Database
   

Database

 
GeneralAccessing MS SQL-Server via ADO Pin
am_16-Sep-02 3:10
am_16-Sep-02 3:10 
GeneralRe: Accessing MS SQL-Server via ADO Pin
Jon Hulatt16-Sep-02 22:19
Jon Hulatt16-Sep-02 22:19 
GeneralRe: Accessing MS SQL-Server via ADO Pin
am_16-Sep-02 22:38
am_16-Sep-02 22:38 
GeneralRe: Accessing MS SQL-Server via ADO Pin
Jon Hulatt16-Sep-02 23:45
Jon Hulatt16-Sep-02 23:45 
GeneralRe: Accessing MS SQL-Server via ADO Pin
am_17-Sep-02 1:55
am_17-Sep-02 1:55 
GeneralRe: Accessing MS SQL-Server via ADO Pin
Doug15-Oct-02 15:29
Doug15-Oct-02 15:29 
GeneralConvert Varchar/DateTime help pleeeeeeeze Pin
Megan Forbes15-Sep-02 23:49
Megan Forbes15-Sep-02 23:49 
GeneralRe: Convert Varchar/DateTime help pleeeeeeeze Pin
Jon Hulatt16-Sep-02 1:47
Jon Hulatt16-Sep-02 1:47 
Using ASP and SQL mixed gives tonnes of problems with dateformat. Largely becayse america use MM-DD-YYYY and the rest of the world use the more logical DD-MM-YYYY.

I get round the problem by doing the following:-

1. throughout my asp application, I always use the DD-MM-YYYY dateformat.

2. When passing a date to SQL, i send a string from this function:-

Function GetSQLDate ( dtDate)
  ' check dtDate is a Variant->Date type
  If Not IsDate(dtDate) then
     Err.Raise vbObjectError + 1024, "Global::Function::GetSQLDate","Argument not a date"
  End If

  Dim dpYear, dpMonth, dpDay, dpHour, dpMinute, dpSecond
  dpYear=Year(CDate(dtDate))
  dpMonth=Month(CDate(dtDate))
  dpDay=Day(CDate(dtDate))
  dpHour=Hour(CDate(dtDate))
  dpMinute=Minute(CDate(dtDate))
  dpSecond=Second(CDate(dtDate))

  if Not Len(dpYear) = 4 then dpYear="20" & dpYear
  if Not Len(dpMonth) = 2 then dpMonth = "0" & dpMonth
  if Not Len(dpDay) = 2 then dpDay = "0" & dpDay
  if Not Len(dpHour) = 2 then dpHour = "0" & dpHour
  if Not Len(dpMinute) = 2 then dpMinute = "0" & dpMinute
  if Not Len(dpSecond) = 2 then dpSecond = "0" & dpSecond

  GetSQLDate=dpYear & "-" & dpMonth & "-" & dpDay & " " & dpHour & ":" & dpMinute & ":" & dpSecond

End Function


This puts the date for sql in an almost foolproof dateformat.

STL is a religeon. Enquiries to Reverend Christian Graus
GeneralRe: Convert Varchar/DateTime help pleeeeeeeze Pin
Richard Deeming16-Sep-02 7:53
mveRichard Deeming16-Sep-02 7:53 
Generalno current record Pin
Mike Fenske13-Sep-02 7:58
Mike Fenske13-Sep-02 7:58 
GeneralMDAC 2.7 May Contain A Regression... Pin
James R. Twine13-Sep-02 5:36
James R. Twine13-Sep-02 5:36 
GeneralOracle error Pin
Bill Dean12-Sep-02 4:16
Bill Dean12-Sep-02 4:16 
GeneralRe: Oracle error Pin
Mark Conger13-Sep-02 8:54
Mark Conger13-Sep-02 8:54 
GeneralSQLServer problem: fetching TEXT field using OLE DB Pin
taualex12-Sep-02 3:40
taualex12-Sep-02 3:40 
GeneralRe: SQLServer problem: fetching TEXT field using OLE DB Pin
James R. Twine13-Sep-02 5:39
James R. Twine13-Sep-02 5:39 
GeneralRe: SQLServer problem: fetching TEXT field using OLE DB Pin
taualex13-Sep-02 8:04
taualex13-Sep-02 8:04 
GeneralRe: SQLServer problem: fetching TEXT field using OLE DB Pin
James R. Twine13-Sep-02 9:02
James R. Twine13-Sep-02 9:02 
QuestionTRICKY - How to SELECT TOP X records when using UNION? Pin
Garth11-Sep-02 17:31
Garth11-Sep-02 17:31 
AnswerRe: TRICKY - How to SELECT TOP X records when using UNION? Pin
Rein Hillmann11-Sep-02 19:11
Rein Hillmann11-Sep-02 19:11 
AnswerRe: TRICKY - How to SELECT TOP X records when using UNION? Pin
Richard Deeming13-Sep-02 6:01
mveRichard Deeming13-Sep-02 6:01 
GeneralSQLDMO & DTS Pin
Paul Watson10-Sep-02 7:08
sitebuilderPaul Watson10-Sep-02 7:08 
GeneralRe: SQLDMO & DTS Pin
Nick Parker11-Sep-02 13:12
protectorNick Parker11-Sep-02 13:12 
Questionsp_OASetProperty limitations? Pin
Jeremy Falcon6-Sep-02 7:50
professionalJeremy Falcon6-Sep-02 7:50 
AnswerRe: sp_OASetProperty limitations? Pin
Jeremy Falcon6-Sep-02 9:33
professionalJeremy Falcon6-Sep-02 9:33 
AnswerRe: sp_OASetProperty limitations? Pin
Nick Parker11-Sep-02 8:40
protectorNick Parker11-Sep-02 8:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.