Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

format function in query

Status
Not open for further replies.

sealahu

Programmer
Aug 5, 2003
16
US
In the below queue, I use a format function.

The query read like:
**********************
select Format([setup date],"mmmm dd yyyy")
from accounts
***********************

I got error:

function isn't available in expression in
Format([setup date],"mmmm dd yyyy")

How do I correct it? Can I use other function to format the date to avoid this error
 
Ok..

is this a saved query, or is it in VBA Code?

If it's a saved query, then use this:
Code:
select [setup date] from accounts
Then, when you are in design mode, open the properties, and put "mmmm dd yyyy" in the format field.

If it is in VBA Code...

use
Code:
select Format([setup date],"mmmm dd yyyy") as Setup_Date
from accounts

You have to tell the computer the name of the field if you use a formula.

GComyn
 
Hi sealahu,

Can you give us a bit more information. Where are you doing this? It works for me and in principle there's no reason why it shouldn't work for you.

Enjoy,
Tony
 
This is just a independent query in MS Access,

Yes I did use 'AS Setup_Date'

select Format([setup date],"mmmm dd yyyy") as Setup_Date
from accounts

One thing I noticed if I check a reference 'Microsoft data Formating object library', then I can run this query.

The database exists a mail merge program to a MS word document, in the reference,
some user has 'Microsoft word 8.0 object library'; some users have 'Microsoft word 10.0 object library',

I happened to have 'Microsoft word 10.0 object library' checked, I got error when I run this query; if I check a reference 'Microsoft data Formating object library', then I can run this query. BUT other people have 'Microsoft word 8.0 object library' CAN NOT run the query any more.

I don't know what is going on? Anybody know about this
'Microsoft word 8.0/10.0 object library' ? Can I ask about our PC group to Downgrade the object library from 10.0 to 8.0?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top