Subject: | Re: Local SQL Where Cause
| Date: | Wed, 22 Jul 2020 13:21:59 -0400
| From: | Kevin Baker <shcsbaker@gmail.com>
| Newsgroups: | pnews.paradox-programming
|
ahhh, I see what you mean... Thanks!!
On 7/22/2020 1:12 PM, Mark Bannister wrote:
> take out the '
>
> WHERE (ck.Bud2YrMo = ~rc)
>
> If your default format puts "," in the number you will have to use a
> format spec to cast your value to string rc = format(RecD,"spec")
>
> On 7/22/2020 4: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?
>
|