| Author |
Topic |
|
sportsman667
Starting Member
4 Posts |
Posted - 2007-04-16 : 15:33:17
|
I am trying to list all projects managed by technicians who joined in the year 2005 or later. the techno column is in both tables(test_technicians & test_projects) and the projno is only in the test_projects table. Whats wrong with my coding? I keep getting an error message that the FROM statement is in the wrong placeSELECT techno, projno TstartdateTO_CHAR(Tstartdate,'YYYY') AS Tech Start DateFROM test_technicians, test_projectsWHERE test_technicians.techno = test_projects.techno AND TO_CHAR(Tstartdate,'YYYY') >= '2005'; |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-04-16 : 15:37:26
|
| Are you even using SQL Server? I'm not familiar with TO_CHAR function. SQL Server Books Online doesn't turn up anything, so I suspect either TO_CHAR is a custom function or you aren't using SQL Server.SELECT techno, projno, Tstartdate, YEAR(Tstartdate) AS TechStartDateFROM test_techniciansINNER JOIN test_projectsON test_technicians.techno = test_projects.techno WHERE Tstartdate >= '01-01-2005'Tara Kizerhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
sportsman667
Starting Member
4 Posts |
Posted - 2007-04-16 : 15:39:24
|
| Im using oracle 10g |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2007-04-16 : 15:45:12
|
| This is a Microsoft SQL Server forum. You might get better advice at a forum that specializes in Oracle, don't you think?- Jeffhttp://weblogs.sqlteam.com/JeffS |
 |
|
|
sportsman667
Starting Member
4 Posts |
Posted - 2007-04-16 : 15:49:01
|
| indeed. sorry :/ |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-04-17 : 04:15:00
|
| http://www.dbforums.com might be your best bet.Kristen |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-04-17 : 07:08:26
|
| orwww.orafaq.comMadhivananFailing to plan is Planning to fail |
 |
|
|
mcrowley
Aged Yak Warrior
771 Posts |
Posted - 2007-04-17 : 09:13:42
|
| There is a missing comma or two in the select list. |
 |
|
|
sshelper
Posting Yak Master
216 Posts |
Posted - 2007-04-17 : 09:25:23
|
| Try putting the "Tech Start Date" column alias in quotes since it has spaces in them :SELECT techno, projno TstartdateTO_CHAR(Tstartdate,'YYYY') AS "Tech Start Date" FROM test_technicians, test_projectsWHERE test_technicians.techno = test_projects.techno AND TO_CHAR(Tstartdate,'YYYY') >= '2005';SQL Server Helperhttp://www.sql-server-helper.com |
 |
|
|
|