Click to See Complete Forum and Search --> : SQL- Stored Procedure question - thanks


rayxu
March 21st, 2001, 10:58 AM
SQL Database tables

test001002 (001002 = yymmdd)
test001112
test001122
test001123

Note: All the above tables have the same structure and with the 'AccountNo' field.


Input parameter (001123)

Requirement:

display the AccountNo fields of all the above tables if the date (last 6 character of the table name)" is equal to or prior to the "Input parameter (001123) (must be within the same month and same year). In this case, display the 'AccountNo' fields of the following tables

test001112
test001122
test001123

Note: test001002 table is not included because it is October which is not in the same month as the Input parameter (001123--yymmdd).

Note: you can create a tmp table and add AccountNo fields of three tables one after another

Please help me out. thanks

bigfredb
March 21st, 2001, 12:08 PM
How you would accomplish this depends on which verson of SQL you are using.

Are you using MS SQL Server 6.5, 7.0, 2000 or Oracle DB?

rayxu
March 21st, 2001, 12:14 PM
thanks

I am using MS SQL 7