I have a table that looks like this:
record vnd_nbr vnd_name srtinvnbr inv_dte srtinvamt
1 101535821 TRAVELITE 82498 11/31/1999 824.98
2 101535821 TRAVELITE 85666 12/1/1998 500.01
3 101535821 TRAVELITE 65577 5/8/2001 5820.01
4 101535821 TRAVELITE 95888 6/5/2000 1015358.21
I would like to write a query or stored procedure to query out anything that has the:
1. vnd_nbr = srtinvamt (record 4)
2. srtinvnbr = srtinvamt (record 1)
3. inv_dte = srtinvamt (record 3)
Each field has a different datatype, so I know i have to convert the fields into a similar format in order to find out if they are equal to each other. I'm just not sure how to go about doing this.
The fields are currently formatted like this:
1.srtinvamt = (money, Null)
2.vnd_nbr = (char(20),Null)
3.srtinvnbr = (char(30),Null)
4.inv_dte = (datetime, Null)
Any help would be appreciated.
record vnd_nbr vnd_name srtinvnbr inv_dte srtinvamt
1 101535821 TRAVELITE 82498 11/31/1999 824.98
2 101535821 TRAVELITE 85666 12/1/1998 500.01
3 101535821 TRAVELITE 65577 5/8/2001 5820.01
4 101535821 TRAVELITE 95888 6/5/2000 1015358.21
I would like to write a query or stored procedure to query out anything that has the:
1. vnd_nbr = srtinvamt (record 4)
2. srtinvnbr = srtinvamt (record 1)
3. inv_dte = srtinvamt (record 3)
Each field has a different datatype, so I know i have to convert the fields into a similar format in order to find out if they are equal to each other. I'm just not sure how to go about doing this.
The fields are currently formatted like this:
1.srtinvamt = (money, Null)
2.vnd_nbr = (char(20),Null)
3.srtinvnbr = (char(30),Null)
4.inv_dte = (datetime, Null)
Any help would be appreciated.