SkysLastChance

[SOLVED] Noob Question

5 posts in this topic

#1 ·  Posted (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 by SkysLastChance

Sky

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


Sky

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - 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. 


Sky

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

1 person likes this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

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