Setting a defualt value in sql

  • Thread starter Thread starter Mustafa
  • Start date Start date
M

Mustafa

Hi,

I have an sql statement that creates a table, however I
would like to set one of the field's (usagedate) default
value to =now(). what do i need to add to my sql string?

Thanks in advance
 
I have an sql statement that creates a table, however I
would like to set one of the field's (usagedate) default
value to =now(). what do i need to add to my sql string?

try something like

UPDATE table SET table.field = Now()

to update all fields in a table (update query)
add a WHERE-statement for selected rows

to set a value by default (append query) do
INSERT INTO table ( field )
SELECT Now() AS UsageDate

like before you can select rows by including a FROM-WHERE-statement

hope this helps.

Joe Voll.
 
Back
Top