hatena様
重ねての解答ありがとうございます。
やりたいことは下記のことです。
昨日は、
Q_指数買い目順位2⇒クエリ1
Q_指数買い目順位5⇒クエリ2
SELECT
T1.[レースID]
,0 AS 返還フラグ
,4 AS 券種
,T1.[ゼッケン] AS 軸2
,T2.[ゼッケン] AS ヒモ5
,0 AS 空白
,100 AS 購入金額
,Null AS 空白2
,"A" AS 自信
FROM (
Q_指数買い目順位2 AS T1 INNER JOIN Q_指数買い目順位5 AS T2
ON T1.[レースID] = T2.[レースID]
)
ORDER BY T1.[レースID];
SELECT
クエリ1.,
クエリ2.
FROM
(SELECT
Left([レースID馬],16) AS レースID
,0 AS 返還フラグ
,4 AS 券種
,Val(Right([T1].[レースID馬],2)) AS 軸2
,0 AS 空白
,100 AS 購入金額
,Null AS 空白2
,"A" AS 自信
FROM MT_指数追加 AS T1
WHERE T1.順位=2
) As クエリ1 INNER JOIN
(SELECT
Left([レースID馬],16) AS レースID
,Val(Right([レースID馬],2)) AS ヒモ
FROM MT_指数追加 AS T2
WHERE T2.順位=5
) AS クエリ2
ON クエリ1.レースID = クエリ2.レースID;
問題なく作動します
ありがとうございます。
SELECT
T1.[レースID]
,0 AS 返還フラグ
,4 AS 券種
,Val(Right([T1].[レースID馬],2)) AS 軸2
,Val(Right([T2].[レースID馬],2)) AS ヒモ
,0 AS 空白
,100 AS 購入金額
,Null AS 空白2
,"A" AS 自信
FROM
(SELECT
FROM MT_指数追加 AS T1
WHERE T1.順位=2
) As AS T1 INNER JOIN
(SELECT
FROM MT_指数追加 AS T2
WHERE T2.順位=5
) AS AS T2
ON Left([T1].レースID馬,16) = Left([T2].レースID馬,16)
昨日はご不快な質問をして、申し訳ありませんでした。
今回記載したコードも全くとんちんかんな、コードでしょうか?
お手すきのときに回答いただけたら幸いです。