|
-
Aug 3rd, 2000, 12:29 PM
#1
Thread Starter
Member
I need a SQL query for Access. I have a table, Policies, with columns 'Type','Age', and 'Duration' . I have other tables Type1, Type2, Type3, and Type4. The rows for these 4 tables are 'Age' and the columns are 'Duration'. I need to use the info from the Policies table to call the correct 'Type' table, and get the data from the correct cell based upon the 'age' and 'duration'. How would I do this in a VB program?
Is there a way to do this in Access and have the results in a column in the same table or a query or on a form?
Thanks
Tim
VB6, SP4
GT Vengeance
-
Aug 3rd, 2000, 01:40 PM
#2
Hyperactive Member
In the POLICIES table, what are the values that appear in the Type column? Is it numeric like 1, 2, 3, 4 or text like Type1, Type2, etc.? You need to somehow match the value of Type of the current record with the table name for that type.
e.g. if the value is numeric:
"SELECT * From Type" & myRS.Fields("TYPE").Value & " Where
AGE = " & myRS.Fields("AGE").Value & " And DURATION = " & myRS.Fields("DURATION").Value
[Edited by DrewDog_21 on 08-03-2000 at 02:45 PM]
-
Aug 3rd, 2000, 02:05 PM
#3
Thread Starter
Member
'Type' is a text field,as is the names of the other tables, but wouldn't that work if I changed myRS.Fields("TYPE").Value to myRS.Fields("TYPE").Text, or something as such?
Tim
VB6, SP4
GT Vengeance
-
Aug 3rd, 2000, 02:16 PM
#4
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|