LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default sql string, +'/'+convert(char(3)..)

strSQL has no space between "receiver_line" in the first line of
code and "where" in the second, so it begins
select * from receiver_linewhere ....

So make the first line say
strSql = "select * from receiver_line " & _

BTW you can debug this sort of problem by stepping through
the code and lookin at the value of strSQL in the Immediate
window.

Hope this helps
Andrew


doristsr wrote:
HI;

I m writing excel vba, i would like to execute a SQL query :

select * from receiver_line
where purc_order_id+'/'+cast(purc_order_line_no as varchar(3))
+'/'+receiver_id+'/'+cast(line_no as varchar(3))
not in( select purc_order_id+'/'+cast(purc_order_line_no as
varchar(3))
+'/'+receiver_id+'/'+cast(receiver_line_no as varchar(3))
from payable_line where receiver_id is not null )

may i know how do i write it in vba?

can it be like the following?

strSql = "select * from receiver_line" & _
"where purc_order_id+'/'+convert(char(3),
purc_order_line_no)+'/'+receiver_id+'/'+convert(char(3),line_no)" & _
"not in( select
purc_order_id+'/'+convert(char(3),purc_order_line_no)+'/'+receiver_id+'/'+convert(char(3),receiver_line_no)"
& _
"from payable_line where receiver_id is not null )"

i keep on getting error, can anyone correct me? thanks for your great
help :)

Doris


--
doristsr
------------------------------------------------------------------------
doristsr's Profile: http://www.excelforum.com/member.php...o&userid=35881
View this thread: http://www.excelforum.com/showthread...hreadid=556758


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I find a value from one cell in a char string in another? tiredazdaddy Excel Worksheet Functions 2 November 20th 08 05:40 PM
How to retrieve certain char within a string? Eric Excel Discussion (Misc queries) 1 July 3rd 07 03:02 AM
How to verify the first char of the string in excel? Eric Excel Discussion (Misc queries) 0 November 30th 06 03:57 AM
string/char CONTAINS function? jim sturtz Excel Worksheet Functions 3 May 31st 06 07:20 PM
last char of a string Buddy Lee Excel Programming 9 November 11th 05 02:02 AM


All times are GMT +1. The time now is 01:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"