Hein
|
Posted: 11/19/2003, 11:23 AM |
|
Need some help with this one:
I want to find one record in a table using two search variables. Let's say in a table you have a colletion of AssetID's and a collection of dates. I want to find the one unique record where the AssetID is equal to a certain number and the date is also equal to a certain date - how can I do that in ASP and CC studio? Thanks in advance!
|
|
|
Edd
|
Posted: 11/20/2003, 5:32 PM |
|
Firstly define / test your SQL in a query builder so you know how to get the specific result you want.
Then transpose that back in to CCS, eg
Select Top 1 AssetID from Assets inner join Assets.Prime ON Asset.PrimaryAsset = Assets.PrimaryAsset where (Asset.StartDate > '2003-01-01' and Asset.EndDate < '2003-31-12' OR Asset.EndDate IS NULL) and Asset.PrimaryAsset = 1234)
would be a CCDLookup as
AssetID = CCDLookup("Top 1 AssetID", "Assets inner join Assets.Prime ON Asset.PrimaryAsset = Assets.PrimaryAsset", "(Asset.StartDate > '2003-01-01' and (Asset.EndDate < '2003-31-12' OR Asset.EndDate IS NULL)) and Asset.PrimaryAsset = 1234), DBwhatever)
Hope this helps
Edd
|
|
|
|