Subject: | Re: Local SQL Where Cause
| Date: | Wed, 22 Jul 2020 12:14:06 -0500
| From: | Mark Bannister <markRemove@THISinjection-moldings.com>
| Newsgroups: | pnews.paradox-programming
|
comas in the number mess it up. 2020.07 would work
On 7/22/2020 5:20 AM, Kevin Baker wrote:
> so the var has a value of 2,020.07 and when I use it as shown below, I
> get an error:
>
> WHERE (ck.Bud2YrMo = 2,020.07)
>
>
>
>
> On 7/22/2020 5:32 AM, Kevin Baker wrote:
>> I've got a number field in a DB and I'm trying to use that field in
>> the WHERE cause of a SQL statement.
>>
>> The value will be selected by the user, so I store their selected
>> value in a form var called RecD using the number as type.
>>
>> Try #1 = Type mismatch in expression
>> SELECT
>> ck."ckDate", ck.Num, ck.tranType, ck.Payee, ck.payment,
>> ck.deposit, ck.Bud2YrMo
>> FROM Checks ck
>> WHERE (ck.Bud2YrMo = '~RecD')
>> GROUP By ck."ckDate", ck.Num, ck.tranType, ck.Payee, ck.payment,
>> ck.deposit, ck.Bud2YrMo
>>
>>
>> Try #2 = Type mismatch in expression
>> WHERE (ck.Bud2YrMo = CAST('~RecD' as CHAR))
>>
>> Try #3 = Type mismatch in expression
>> rc = string(RecD)
>>
>> WHERE (ck.Bud2YrMo = '~rc')
>>
>> How do I use a numeric value in the WHERE clause?
|