Minggu, 25 Januari 2015

Re: [MS_AccessPros] #Type! error

 

Robin-

Internally, a date/time data type is a Double - the integer part is the number of days since Dec 31, 1899, and the fractional part is the time as a fraction of a day (0.5 = noon). Date/Time values display on your machine using the default Short Date setting for your locale. Because you're in Australia, that's probably dd/mm/yyyy. If you want the date/time value to appear as d mmm yyyy, simply set the Format property of the control that displays the date.

You are getting a data type error because you're trying to assign an unrecognized string to a date/time value. It *might* work if you were to add # characters as delimiters, but it would still be stored internally as a Double.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

On Jan 26, 2015, at 4:36 AM, Robin Chapple robinski@westnet.com.au [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

I am preparing a report where I need a date to record as 1 Jul 1928.

I am using this SQL in the data field of the report.

=Format$([YearStart],"d mmm yyyy")

The field is in 'Date/Time' format in the database and shows as:

1/07/1928

The report gives me this error:

#Type!

What have I missed?

Many thanks,

Robin Chapple

------------------------------------
Posted by: Robin Chapple <robinski@westnet.com.au>
------------------------------------

------------------------------------

Yahoo Groups Links

__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar