Jump to content
Sign in to follow this  
SkysLastChance

[SOLVED] Noob Question

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

Life's simple. You make choices and you don't look back.

Share this post


Link to post
Share on other sites

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


Life's simple. You make choices and you don't look back.

Share this post


Link to post
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 2020-09-05 - Version 1.5.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

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. 


Life's simple. You make choices and you don't look back.

Share this post


Link to post
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


A cross-platform implementation of the AutoIt language

My contributions to the AutoIt Community ##AutoIt at freenode, real-time chat

3fHNZJ.gif

Spoiler

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) intend to do that to anybody.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...