Simple question (for once) :) (1 Viewer)

border20

Registered User.
Local time
Today, 05:51
Joined
Jan 8, 2003
Messages
92
mo1 = DAvg("[field 1]", "TABLE", "[field 2] = productnum")

I have the folowing SQL statement, but the the condition field gives me an error.

productnum is not in my database but is an Integer take a numerical value of 1 to 10... How do i change my SQL statement to accept this so that when I give productnum a certan value like '3' the equivlent condition is "[field 2] = '3'"

??

thx for your help !
Frank
 

Mile-O

Back once again...
Local time
Today, 05:51
Joined
Dec 10, 2002
Messages
11,316
If productnum is numerical:

Code:
mo1 = DAvg("[field 1]", "TABLE", "[field 2] = " &  productnum)

If productnum is a string:

Code:
mo1 = DAvg("[field 1]", "TABLE", "[field 2] = '" & productnum & "'")
 

Users who are viewing this thread

Top Bottom