|Subject:||Re: Local SQL Where Cause
|Date:||Wed, 22 Jul 2020 12:12:54 -0500
|From:||Mark Bannister <markRemove@THISinjection-moldings.com>
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
> ck."ckDate", ck.Num, ck.tranType, ck.Payee, ck.payment, ck.deposit,
> 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?