Click here to Skip to main content
15,900,641 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have two tables
1. tblVehicle with Vehid as primary key,Custid as foreign key and Vehentrytime as a table of column
2. tblCusotmer with Custid as primary key and Vehtype as table column

i want to select those vehicle types from tblCustomer whose entry time is as selected by the query from tblVehicle

what would be the query for selecting such datas from two tables
reply with the codes
with regards bishnu
Posted

try this

SQL
Select TC.Vehtype from tblCusotmer TC inner join tblVehicle TV
on TC.Custid =TV.Custid  
where  TV.Vehentrytime='your datetime parameter'    
 
Share this answer
 
Try this:
SQL
SELECT C.vehicletype FROM tblCusotmer  C INNER JOIN tblVehicle V ON C.Custid =V.Custid WHERE  V.Vehentrytim='Your Selected datetime';
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900