Jump to content

[SOLVED] Noob Question


SkysLastChance
 Share

Recommended Posts

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 by SkysLastChance

You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott

Link to comment
Share on other sites

I know nothing about SQL but shouldn't be

and Amount > '0'

changed to

and Amount > 0

for a numeric comparison?

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

 

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

  • 3 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...