SkysLastChance Posted January 10, 2017 Posted January 10, 2017 (edited) SELECT ProcedureID,BatchDate,ServiceDate,ProcedureDescription,Amount,BillingProviderID FROM dbo.PbrChargeTransactions WHERE BillingProviderID = 'SEU.JO' and ServiceDate Between '2016-01-01 and 2016-12-31' and Amount > '0' ORDER BY ServiceDate I am using 2012 server and was wondering why my > sign is not working? I get Msg 102, Level 15, State 1, Line 5 Incorrect syntax near '>'. Edited January 30, 2017 by SkysLastChance You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott
SkysLastChance Posted January 10, 2017 Author Posted January 10, 2017 I figured it out the problem was here and ServiceDate Between '2016-01-01 and 2016-12-31' - Wrong and ServiceDate Between '2016-01-01' and '2016-12-31' - Right You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott
water Posted January 10, 2017 Posted January 10, 2017 I know nothing about SQL but shouldn't be and Amount > '0' changed to and Amount > 0 for a numeric comparison? Skysnake 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
SkysLastChance Posted January 10, 2017 Author Posted January 10, 2017 I know close to nothing. I am just starting to pick it up again. I tried it both ways and it works. I wonder if there is a downside to eitherway. You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott
TheDcoder Posted January 13, 2017 Posted January 13, 2017 On 11/1/2017 at 4:10 AM, SkysLastChance said: I wonder if there is a downside to eitherway. I think the string comparison converts the character to its decimal equivalent before comparing... just a guess, I have not done any SQL Xandy and Skysnake 2 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
steveeye Posted May 20, 2017 Posted May 20, 2017 the string will work both ways . on ints and decs. Skysnake 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now