Combine 2 queries in Access

benedictine191

Registered User.
Local time
Yesterday, 16:15
Joined
Dec 1, 2015
Messages
12
[SOLVED]Combine 2 queries in Access

Hi, im newbie to access, my name is Ben,
currently i have two syntax queries

Code:
SELECT [Raw Dealer].CHANNEL, [Raw Dealer].MD, [Raw Dealer].DEALER, [Raw Dealer].MATERIAL, [Raw Dealer].IMEI, [Raw Dealer].[SOLD TO], [Export MCS].MODEL_CD, [Export MCS].SURVEY_DATE, [Export MCS].FOTA_DATE, 
iif([export mcs].survey_date<=[export mcs].fota_date,[export mcs].survey_date,[export mcs].fota_date) as MIN,
iif(isnull([export mcs].survey_date),[export mcs].fota_date,[export mcs].survey_date) as null
FROM [Export MCS] INNER JOIN [Raw Dealer] ON [Export MCS].IMEI = [Raw Dealer].IMEI;

the result currently is like this

see attachment pic 5

but what i want is like this

see attachment pic 3

the output what i want is, i compare fota date and survey date, which is smaller, i used it, but if any of them is null, i used the filled one.

thank you
Ben
 

Attachments

  • Compare3.png
    Compare3.png
    3 KB · Views: 102
  • Compare5.png
    Compare5.png
    8.2 KB · Views: 115
Last edited:
I can not see any relationship between the data you gets and the data you want to get.
So I would suggest that you show some raw data, or even better attacher one stripped down version of your database with some sample data in it, zip it.
 
I can not see any relationship between the data you gets and the data you want to get.
So I would suggest that you show some raw data, or even better attacher one stripped down version of your database with some sample data in it, zip it.

im sorry bro for the miss of the raw data
finally i got the clue and solve it..thank you for the helps :)
 

Users who are viewing this thread

Back
Top Bottom