Denis
|
| Posted: 06/10/2004, 2:40 AM |
|
Hi,
the problem is.... I have to select one field in a table based on two variables.
I tried for istance:
label1.value = CStr(CCDLookUp("approved","table","UserID=1 AND CountryID=3", DBSqlServer)) and it works,
but the problem is how to change UserId and CountryID to be variables, I can write:
dim UserId
userid = session("UserID")
label1.value = CStr(CCDLookUp("approved","table","UserID="& userid, DBSqlServer))
but I don't know how to add second variable (CountryID) in sql query and make it work...
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 06/10/2004, 3:25 AM |
|
Denis,
label1.value = CStr(CCDLookUp("approved","table","UserID="& Session("UserID") & " AND CountryID=" & XYZ, DBSqlServer))
XYZ should be replaced with Session("CountryID"), or FormName.FieldName.CountryID, etc. depending where you're retrieving the country from.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
|