R
Rick Dunmire
Hello everyone
I need to select the most recent date from a recordset like this.
A customer has 3 inspection dates I need the most recent date for that
customer.
Here is the sql statement as of now.
PARAMETERS Combo1 Short, Combo2 Short;
SELECT Vehicle.registrant_name, Customer.street_address_1,
Customer.street_address_2, Customer.city, Customer.state, Customer.zip_code,
Vehicle.vehicle_year, Vehicle.vehicle_make, Vehicle.vehicle_model,
Vehicle.license_plate_expiration_month, Vehicle.status,
Inspection.inspection_date
FROM (Customer INNER JOIN Vehicle ON Customer.pk_customer =
Vehicle.fk_customer) LEFT JOIN Inspection ON Vehicle.pk_vehicle =
Inspection.fk_vehicle
WHERE (((Vehicle.status)="0") AND
((([Vehicle].[license_plate_expiration_month])-(([Vehicle].[license_plate_ex
piration_month])<[Combo1])*100) Between [Combo1] And
[Combo2]-([Combo2]<[Combo1])*100) AND
((nz([Vehicle].[license_plate_expiration_month],0))>0))
ORDER BY
(Vehicle.license_plate_expiration_month)-((Vehicle.license_plate_expiration_
month)<[Combo1])*100;
I guess I need some kind of WHERE clause in there about the most recent
Inspection.inspection_date.
What am I in need of?
Thanks
Rick Dunmire
I need to select the most recent date from a recordset like this.
A customer has 3 inspection dates I need the most recent date for that
customer.
Here is the sql statement as of now.
PARAMETERS Combo1 Short, Combo2 Short;
SELECT Vehicle.registrant_name, Customer.street_address_1,
Customer.street_address_2, Customer.city, Customer.state, Customer.zip_code,
Vehicle.vehicle_year, Vehicle.vehicle_make, Vehicle.vehicle_model,
Vehicle.license_plate_expiration_month, Vehicle.status,
Inspection.inspection_date
FROM (Customer INNER JOIN Vehicle ON Customer.pk_customer =
Vehicle.fk_customer) LEFT JOIN Inspection ON Vehicle.pk_vehicle =
Inspection.fk_vehicle
WHERE (((Vehicle.status)="0") AND
((([Vehicle].[license_plate_expiration_month])-(([Vehicle].[license_plate_ex
piration_month])<[Combo1])*100) Between [Combo1] And
[Combo2]-([Combo2]<[Combo1])*100) AND
((nz([Vehicle].[license_plate_expiration_month],0))>0))
ORDER BY
(Vehicle.license_plate_expiration_month)-((Vehicle.license_plate_expiration_
month)<[Combo1])*100;
I guess I need some kind of WHERE clause in there about the most recent
Inspection.inspection_date.
What am I in need of?
Thanks
Rick Dunmire