I have a Windows app that for some reason isn't converting a DateTime column over to the correct format. The column is defined in a SQL Server 2008 DB as a "DateTime" datatype. In my VB.Net app, I've created a table with it's associated columns and defined the particular date column the same as such:
My SQL statement looks like the following. I tried 2 different ways of retrieving the date. These statements were ran in the SSMS.
SELECT creep_ID,runNO,intervalPoint,output,[error],CONVERT(DateTime,startTime,9) AS startTime,printOnCert FROM TEST_DETAILS_Creep WHERE creep_ID = 66
SELECT creep_ID,runNO,intervalPoint,output,[error],CONVERT(DateTime,startTime,109) AS startTime,printOnCert FROM TEST_DETAILS_Creep WHERE creep_ID = 66
The problem that I'm having is that the App needs to display the "startTime" like this: 1/12/2015 08:34:08
What it's doing is displaying the "startTime" like this: 1/12/2015 08:34 AM
As far as using the CONVERT statement in my SQL script, I've tried the format of 109 and it still doesn't work. I'm not doing any kind of data manipulation when I assign the DataTable to the DataGridView's datasource. Here is what that logic looks like. "bsCreep" is just a BindingSource.
bsCreep.DataSource = EH.DataSet.Tables(0)
bsCreep.Filter = "runNO = " & iCreepRunIDX
dgvCreep.DataSource = bsCreep