Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem

Status
Not open for further replies.

radubalmus

Programmer
Apr 26, 2007
49
EU
i am building a query depending if some cells(my interface is excel) have text or not..
it is working, but when i am trying to read from a certain field it gives me an error "80040e14"
ex: So the following works:
Code:
SELECT testorder,shortyear,orderdate,requester,tel,weno,partno,partname,samples,costcat,status,product_rating FROM test_orders WHERE orderdate>=(1/1/2007) AND (costcat='2.4 CoP')
or
Code:
SELECT testorder,shortyear,orderdate,requester,tel,weno,partno,partname,samples,costcat,status,product_rating FROM test_orders WHERE orderdate>=(1/1/2007) AND (testtype='ES Tests')

but when this query is build i have the error:
Code:
SELECT testorder,shortyear,orderdate,requester,tel,weno,partno,partname,samples,costcat,status,product_rating FROM test_orders WHERE orderdate>=(1/1/2007) AND (status='Open')

is Sql(database or language) sezitive to some words??? or what could be the problem


There are simple solutions for almost every problem! The hard part is to see them!!!!
 
Dates should have apostrophes (single-quote) around them.


Code:
SELECT testorder,shortyear,orderdate,requester,tel,weno,partno,partname,samples,costcat,status,product_rating FROM test_orders WHERE orderdate>=[!]'[/!]1/1/2007[!]'[/!] AND (status='Open')

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Sorry RiverGuy. Your post wasn't there when I first started to respond. [blush]

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
i'll try it. but why thas it work in the other two cases??

There are simple solutions for almost every problem! The hard part is to see them!!!!
 
i've tried with single quote but i am stil getting the same error
i don't think it is about the dates
when i am querying only the dates, or the dates and another field it's working, but when i am querying about this field "status" i get the error.
i have this problem in others modules too
i making a small program with excel interface and now i am switching from Acces to Sql Server(i am modifiing the program(connection) to work with Sql)
and it is rather strange becase some procedures work and other similar keep getiing me the same error.

any ideeas???



There are simple solutions for almost every problem! The hard part is to see them!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top