How to change Number to Text

  • Follow


I have this SQL statement

select abcdoc.*
from abcdoc, order
where order.doc_no = 10599
and order.doc_no || '' = abcdoc.record_key 
and abcdoc.filename = 'order'

When I enter it in SQL view in access i get an error "invalid use of 
vertical bars in query expression" I guess because doc_no is stored as 
numbers & record_key  is stored as text.

Please help.

0
Reply Utf 12/4/2009 6:16:01 PM

|| '' 

Pipes || are how you concantanate data in Oracle. In Access you use the 
ampersand & character. Even then you would need the || or &, along with the 
", on both side of doc_no.

Try this instead:

and CStr(order.doc_no) = abcdoc.record_key 
-- 
Jerry Whittle, Microsoft Access MVP 
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"fruitchunk" wrote:

> I have this SQL statement
> 
> select abcdoc.*
> from abcdoc, order
> where order.doc_no = 10599
> and order.doc_no || '' = abcdoc.record_key 
> and abcdoc.filename = 'order'
> 
> When I enter it in SQL view in access i get an error "invalid use of 
> vertical bars in query expression" I guess because doc_no is stored as 
> numbers & record_key  is stored as text.
> 
> Please help.
> 
0
Reply Utf 12/4/2009 6:24:01 PM


1 Replies
213 Views

(page loaded in 0.03 seconds)

Similiar Articles:
















7/20/2012 3:07:51 PM


Reply: