#1   Report Post  
Jørgen Bondesen
 
Posts: n/a
Default SQl mailmerge.

Hi NG

I have a *.csv mergefile with fieldname: 'Products'

In this field the following words can occur: MP3, MP3_Phone, Phone, CD_MP3

I wish, to mailmerge all records where the word MP3 occur in the
text-string.

I have tried belowed:

Const mergeType01 As String = "MP3"

Const mergeType02 As String = "MP3_Phone"

Const mergeType03 As String = "CD_MP3"



'Do not function: instr
'Products, Products will give all records (test)
Dim strsql As String
strsql = "SELECT * FROM" & MyPath & " \ " & MyFile _
& "WHERE" & (InStr(1, Products, Products, vbTextCompare) 0)"


'Do not function: joker
strsql = "SELECT * FROM" & MyPath & " \ " & MyFile _
& "WHERE(Products = '*" & mergeType01 & "*')"



'This is okay:
'This solution demands programming before new word, and this is
unfortunately not good.

strsql = "SELECT * FROM" & MyPath & " \ " & MyFile _
& "WHERE (Products = '" & mergeType01 & "')" 'continue with: or


I will appreciate any suggestion?
Notice: It is not possible to split the csv-file.

Best regards
Joergen Bondesen


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mailmerge Robert Mailmerge 0 August 19th 05 12:24 AM
Trying to suppress Select Table box in Excel-Word mailmerge Denise Mailmerge 4 June 21st 05 01:08 PM
Protect mailmerge document BillM Mailmerge 1 June 9th 05 12:58 PM
Textboxes in Mailmerge? zSplash Mailmerge 5 March 22nd 05 09:01 PM
Included Property in Word 2003 MailMerge Alessio Mailmerge 1 December 23rd 04 11:26 AM


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

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"