Undefined function 'format'

AuroX7

Registered User.
Local time
Today, 01:16
Joined
Feb 22, 2006
Messages
44
Percentage: Format(CountOfRegular Booking/DCount("*","tblBooking"),"Percent")

I get an error: 'Undefined function 'Format'' - how can I fix this? The above expression is supposed to convert values into percentages. I copied the expression from someone's sample database (to help me) and I just changed the appropriate parts around, but I get that error. I put a space between 'Regular Booking' because that's how it is presented as my field name, but I also put them together as one word to see if that would solve matters, but no luck. The sample database works fine, however.

Sample query expression:
Percentage: Format(CountOfbooleanFieldName/DCount("*","TableName"),"Percent")

Thanks guys. :D
 
Last edited:
You have an embedded space in the field name. Put the field name in square brackets.

Percentage: Format([CountOfRegular Booking]/DCount("*","tblBooking"),"Percent")

^
 
Still happening...

Thank you, but it's still happening. :(
 
Do you have any MISSING references? <ALT> F11 Tools>References
If so, then just UnCheck the ones marked missing.
 
w00t, I got a percentage, but it's the same for all fields, lol.

* Regular Booking: Money Taken: # of Bookings: Percentage Usage:

True £39.00 6 54.55%


False £30.00 5 54.55%


I get a prompt which asks for 'CountOf Regular Booking'. There are, as you can see, 6 regular bookings and 5 non-regular. If I put in the number of regular bookings (6) I get the 54.55% which is fine, but the non-regular (5) also becomes 54.55% when it should be 45.45%. Any idea why it's doing this and how it can be fixed? Thank you for your help once again. :D:D
 
I take it you had a bogus MISSING reference and unchecking it cleared the error. This sounds like a new and different problem and deserving of a new thread.
 
Yep

Yep, I unchecked some MISSING references. Thank you for your help. I have some SQL code which I can copy from the sample query, then just change the appropriate field names etc. That might work. I really appreciate your help. Thank you very much. :):D
 

Users who are viewing this thread

Back
Top Bottom