Setting a defualt value in sql

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
 
J

Joe Voll

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top