AnsweredAssumed Answered

SQL Help

Question asked by spkr25 on Jan 1, 2014
Latest reply on Jan 1, 2014 by spkr25



I have one table, "Deals", with several transactions. There are three fields; InputDate, ID, Amount. with the following data:

Inputdate, ID, Amount

25/11/2013, 001, $100

25/11/2013, 002, $200

25/11/2013, 003, $180

26/11/2013, 001, $100

26/11/2013, 002, $200

26/11/2013, 003, $180

26/11/2013, 004, $243


I would like to have an SQL comparing data from two different dates, in this case; 25/11/2013 and 26/11/2013 then using the ID field to identify which one has been added on the 26/11/2013. The expected result should be 26/11/2013, 004, $243.


I believe an inner join could do this but I am not sure how to create it. I would appreciate some help here.




I am trying to use the following Query:


ExecuteSQL ( "SELECT T1.DateInput, T1.Key

From Deals as T1

Where Not exists (Select 1

From Deals as T2

where T2.DataInput =? and T1.DataInput =? and T2.Key=T1.Key)



Unfortunately, it doesnt work.


Message was edited by: spkr25