SQL between Statement - I think?


#21

Thank you, give me it a try.


#22

I was not able to get the sql code to work, so went back to basic and all works with one exception

sql = "select escrow as VAL1 from rates where SalesPrice >= "& SalesPrice

Works great except that if the SalePrice <10000 then I get this error:

Arithmetic overflow error converting varchar to data type numeric.

All of the fields in the database are varchar (50). If the Salesprice is $10,000 or higher - NO ERROR!

Any suggestions?

Thanks


#23

make numeric fields numeric


#24

Tried that same issue, oddly enough.


#25

you did? would you mind doing a SHOW CREATE TABLE please


#26

Not sure what you are referring too, please explain. Even my IT guy changed the types and no different result. The table starts at 60000 and works at less than that until you get to <10000.


#27

I guess you could run the query in a script or app. Often I prefer to simply use the CLI


#28

I will check with my IT guy and reply at that time. Thank you.


#29

maybe you could get him to write your query for you too... just an idea :sunglasses:


#30

He doesn't do that. But I had a work around since it was weird that under 10000 it had that error and since the table starts at a SalesPrice of $60,000, I did this to remove the error:

if SalesPrice > 10000 then
sql = "select escrow as VAL1 from rates where SalesPrice >= "& SalesPrice
else
sql = "select escrow as VAL1 from rates where SalesPrice >= '60000'"
end if

With the above code all works fine.


#31

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.