Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 "Incorrect" syntax error

Author  Topic 

simflex
Constraint Violating Yak Guru

327 Posts

Posted - 2007-03-03 : 07:36:05
Greetings all,

I use the following code for my MS Access database to get a variety of date values.

I am trying to use it for SQL Server for the first time and I am getting Incorrect syntax near '\'.


Below is the code. Any help is appreciated.

SELECT 'Inmate' as RecordType,
(Birth_Date \ 10000 ) AS BYear, ( (Birth_Date MOD 10000) \ 100) AS BMonth, (Birth_Date MOD 100) AS BDate, * From Inmates
UNION SELECT 'Parolee' as RecordType,
(Birth_Date \ 10000 ) AS BYear, ( (Birth_Date MOD 10000)\ 100) AS BMonth, (Birth_Date MOD 100) AS BDate, * FROM Probationers;

simflex
Constraint Violating Yak Guru

327 Posts

Posted - 2007-03-03 : 09:36:53
Ok, I got this one figured out.
Go to Top of Page
   

- Advertisement -