Jump to content
SkysLastChance

[SOLVED] Noob Question

Recommended Posts

SkysLastChance

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
SkysLastChance

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
water

I know nothing about SQL but shouldn't be

and Amount > '0'

changed to

and Amount > 0

for a numeric comparison?

  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - 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
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
SkysLastChance

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
TheDcoder
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

  • Like 2

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

Spoiler

My contributions to the AutoIt Community

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

3fHNZJ.gif

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

Share this post


Link to post
Share on other sites
steveeye

the string will work both ways . on ints and decs.

  • Like 1

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

×