Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

"The value '' cannot be converted to a number"

New Here ,
Nov 02, 2010 Nov 02, 2010

The value '' cannot be converted to a number

(thats 2 ' not 1 " by the way)

This appears out of the blue when i click Completed Orders on our web based point of sale software.

It occurs on the line stating:

£#NumberFormat((rstotal.subtotal + rsorders.orderpostage),'.__')#

Its extremely odd as we currently have 2 sites with exactly the same code in their POS, one works, one doesnt. :/.

This just suddenly started happening in the last few hours.

Im absolutely stumped. Originally i thought it may be because somehow the table had changed its default to NULL, but it hasnt, its exactly as it should be.

The only modifications ive made to the database are 2 CREATE TABLE query's.

Any help'd be much appreciated.

All sales need to be entered by midnight tonight otherwise the accountant is going to be pissed >_<

1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 02, 2010 Nov 02, 2010

rstotal.subtotal and rsorders.orderpostage

If you output the two values involved, are they numeric or just an empty string?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 02, 2010 Nov 02, 2010

From what i can see, the values are numeric.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 02, 2010 Nov 02, 2010

1. Do a view source in the browser when you get the error - make sure that there really is just a space between those apostrophes, and not something else that the browser isn't rendering in the error message display.

2. Put an isNumeric() in a CFIF before the line that is getting the error, and if it fails dump out the contents of the field between two printable delimiters.  maybe dump the length as well.  maybe dump it in decimal, just in case there is a control character in there - maybe from a copy/paste gone bad.

-reed

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 02, 2010 Nov 02, 2010

<td><input name="searchFor" type="text" class="formInput" onclick="this.value=''" value="search for order, company, person" size="28" /></td>

Is what is returned when i ctrl+f and search for the 2 apostrophes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 02, 2010 Nov 02, 2010

Does the query actually return records?  When I get this type of error it's because I'm looking at an empty query.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 02, 2010 Nov 02, 2010

It returns 2 records, one of which is incomplete. (no total price and clicking on the reference number generated takes me to the admin/index.cfm page)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 03, 2010 Nov 03, 2010

My guess is that either the subtotal or the orderpostage value is empty, and so CF is trying to add a number plus an empty string, which won't work.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 03, 2010 Nov 03, 2010

Its quite odd. Yesterday one completed pos entry went in fine alongside an online order, then theres one line that has the total price missing, and it removes the section of background where it would be over.

Screenshot here:

http://img837.imageshack.us/img837/3528/posl.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 03, 2010 Nov 03, 2010

>> NumberFormat((rstotal.subtotal + rsorders.orderpostage),'.__')

There was an error, so that would make sense. If that is truly the line causing the error then one of those two values is not numeric. At least according to CF.

Did you try the previous suggestions?

ie "...Put an isNumeric() in a CFIF before the line that is getting the error, and if it fails dump out the contents of the field between two printable delimiters..."

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 03, 2010 Nov 03, 2010
LATEST

Well i removed the line and now it works, but doesnt calculate a total.

And Isnumeric doesnt seem to be recognised. It just seems like its ignored.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources