myhc
asked on
SQL String
I need to check against two tables in one string.
Line 1: Normal use
Line2 : A Guess of the string.
Do I not need to use join or something?
Line 1: Normal use
Line2 : A Guess of the string.
Do I not need to use join or something?
SELECT * from Table1 where userID like '123' AND UserEnabled like "true"
SELECT * from Table1 where userID like '123' AND UserEnabled like "true" OR SELECT * from Table2 where userID like '1' AND DataName like "OK"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Carrzkiss, My son! You again. always helping me.
You should just give me your phone number, then I can call you 24/7
You should just give me your phone number, then I can call you 24/7
:)
I just happen to not be able to sleep.
And have to get my site a final run through before taking the newest version live.
So, I thought I would jump on EE and see if I could assist anyone this early 3:54am morning.
Hope you are doing well?
I just happen to not be able to sleep.
And have to get my site a final run through before taking the newest version live.
So, I thought I would jump on EE and see if I could assist anyone this early 3:54am morning.
Hope you are doing well?
ASKER
Yes indeed,
so do you think I should do it a s a join or just a few IF's like in my 1st comment.
so do you think I should do it a s a join or just a few IF's like in my 1st comment.
I am always better at showing Demo's then I am at explaining things.
It is my nature I guess.
http://ee.cffcs.com/Q_24682304/Q_24682304.asp?vid=3&id=125
demo
http://ee.cffcs.com/Q_24682304/Q_24682304.zip
Have a good one.
Carrzkiss
It is my nature I guess.
http://ee.cffcs.com/Q_24682304/Q_24682304.asp?vid=3&id=125
demo
http://ee.cffcs.com/Q_24682304/Q_24682304.zip
Have a good one.
Carrzkiss
I update the asp file in the zip file with some needed information if you would like to redownload it and have a look above the Select Statement.
Have a good one.
Carrzkiss
Have a good one.
Carrzkiss
ASKER
Correct and used
Glad that it worked for you.
Carrzkiss
Author Comments:
Correct and used
Carrzkiss
Author Comments:
Correct and used
ASKER
Or do I just do it the way I have added??
AdminUser = 1
ModUser = 2
--------------------------
Table1
VillageID =1
VillageAdminUSer =1
Table2
VillageID =1
VillageMod =2
select * from Table1 where villageID like '1' and VillageAdminUser like '<CurrentUserID1or2>'
IF not EOF
ModVillage = "True"
ELSE
Select * from Table2 where VillageID like '1' and VillageMod like '<CurrentUserID1or2>'
IF not EOF
ModVillage="True"
ELSE
ModVillage="Flase"
End IF
End IF
response.write("ModVillage
Continue Code...........