Sql Params and getDate()

strider

Well-known member
Joined
Sep 20, 2004
Messages
52
Location
Dublin, Ireland
Programming Experience
1-3
Hey there,
when using a parameterised insertion sql statement has can you specify it to use sqlce getDate function to insert a date into a datetime field


insertCommand.Parameters.Add(New SqlServerCe.SqlParameter("UnitOutDate", SqlDbType.DateTime))
insertCommand.Parameters("UnitOutDate").Value = Date.Now

Im using Date.Now but i want to use SQL's getDate function so as regional settings wont matter

how can i specify to use the sql getDate function???
 
Or just use GetDate() instead of the parameter, right in the SQL.

-tg
 
Buuut, you should still be able to use GetDate() right in the SQL sans Parameter.

-tg
 
ya i know i can use it as "INSERT INTO mytable (mydate) VALUES (getDate())"

but i need to use paramets as the .prepare statement will filter out errors and
also use parameters is more efficient
 
Back
Top