date() won't work...

  • Thread starter Thread starter piero
  • Start date Start date
P

piero

Hi,
I'm building a MSDE database using access 2002.
I would create a field "currentdate" that have the current date such as
default value.
I've try with date() which works in .mdb database, but Sql return a error:
(Sorry for traslation, I'm working on italian O.S.)
"Error: can't create tabel "TableName"
error -2147221309 - [Microsoft] [ODBC SQL Server Driver] [SQL Server] 'date'
not recognized such as function's name"

Any ideas ?

Thanks in advance

Piero
Italy
 
The equivalent function in MS-SQL / MSDE is GETDATE() in English version but
no ideas whether you use the same in Italian or not.
 
I confirm, It works fine !

Thank You very much !

Piero
Italy


Van T. Dinh said:
The equivalent function in MS-SQL / MSDE is GETDATE() in English version but
no ideas whether you use the same in Italian or not.

--
HTH
Van T. Dinh
MVP (Access)



piero said:
Hi,
I'm building a MSDE database using access 2002.
I would create a field "currentdate" that have the current date such as
default value.
I've try with date() which works in .mdb database, but Sql return a error:
(Sorry for traslation, I'm working on italian O.S.)
"Error: can't create tabel "TableName"
error -2147221309 - [Microsoft] [ODBC SQL Server Driver] [SQL Server] 'date'
not recognized such as function's name"

Any ideas ?

Thanks in advance

Piero
Italy
 
Hi,

I had the same problem too, but how can i format it by using only the date.

Greetings,

Ezekiël
Van T. Dinh said:
The equivalent function in MS-SQL / MSDE is GETDATE() in English version but
no ideas whether you use the same in Italian or not.

--
HTH
Van T. Dinh
MVP (Access)



piero said:
Hi,
I'm building a MSDE database using access 2002.
I would create a field "currentdate" that have the current date such as
default value.
I've try with date() which works in .mdb database, but Sql return a error:
(Sorry for traslation, I'm working on italian O.S.)
"Error: can't create tabel "TableName"
error -2147221309 - [Microsoft] [ODBC SQL Server Driver] [SQL Server] 'date'
not recognized such as function's name"

Any ideas ?

Thanks in advance

Piero
Italy
 
Format the problem??? I got no ideas what is the problem.

Please describe in details.
 
what i mean is, when i use getdate() the value is stored like: 11-11-2003
11:00. What i want is 11-11-2003. In access i use
format([date];"dd-mm-yyyy").
 
If you want to use the SQL function, you need to use:

Convert(NChar, GetDate(), 101)

to get rid of the time component.

Note that the result of the above is a String. If you
want to convert back to DateTime value (with zero time
component, you need to use another Convert like:

Convert(DateTime, Convert(NChar, GetDate(), 101), 101)

HTH
Van T. Dinh
MVP (Access)
 
Back
Top