| Author |
Topic |
|
vaiofoxx1
Starting Member
4 Posts |
Posted - 2012-03-21 : 12:24:52
|
| I'm trying to return three columns of information with one column being distinct values and the other two columns of data of the distinct values only. I'm using access and was wondering if the column I'm trying to get Distinct is affected by being alphanumeric. SELECT Order Num, Trade Date,Cost Center Code,Man-Semi-AutoFROM 2011 ReportWHERE Order Num IN (SELECT DISTINCT Order Num FROM 2011 Report);I though this would work but it is not returning Distinct or unique entries. |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
vaiofoxx1
Starting Member
4 Posts |
Posted - 2012-03-21 : 13:41:49
|
| BeforeLTAUC6 12/1/2011 mark manualLTACCL 12/1/2011 Chris manualLTACU6 12/1/2011 Mark manualLTAZY6 12/17/2011 Chris autoLTAZY6 12/1/2011 Sam manualLTAQR7 12/12/2011 Chris manualLTAQR7 12/6/2011 roger manualLTAQS1 12/1/2011 Bob manualLTAZY6 12/1/2011 Chris manualAfterLTAUC6 12/1/2011 mark manualLTACCL 12/1/2011 Chris manualLTACU6 12/1/2011 Mark manualLTAZY6 12/17/2011 Chris autoLTAZY6 12/1/2011 Sam manualLTAQR7 12/12/2011 Chris manualLTAQR7 12/6/2011 roger manualLTAQS1 12/1/2011 Bob manualLTAZY6 12/1/2011 Chris manualI would like it to show this: Distinct Col A with info from other three Col's. LTAUC6 12/1/2011 mark manualLTACCL 12/1/2011 Chris manualLTAZY6 12/17/2011 Chris autoLTAQR7 12/12/2011 Chris manualLTAQS1 12/1/2011 Bob manual |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
vaiofoxx1
Starting Member
4 Posts |
Posted - 2012-03-21 : 15:42:41
|
| I might be a novice but what does the i and o stand for? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-21 : 15:47:32
|
| are you looking for access or t-sql query?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2012-03-21 : 15:50:40
|
quote: Originally posted by vaiofoxx1 I might be a novice but what does the i and o stand for?
Those are called Table Aliases:http://msdn.microsoft.com/en-us/library/ms187455(v=sql.90).aspx |
 |
|
|
vaiofoxx1
Starting Member
4 Posts |
Posted - 2012-03-21 : 15:57:23
|
| I'm using SQL in an access database. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-21 : 16:01:32
|
| you may be better off posting this in Access forum then as there're slight variations in syntax between T-sql and access sql. posting here might prompt people to give t-sql query which might not work well in Access------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|