Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / June 2007

Tip: Looking for answers? Try searching our database.

Filter Merge Data by Date Range

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stuart Troy - 07 Jun 2007 15:31 GMT
Hi Guys,

I'm merging with an SQL table, which includes a date column.
And I need to merge the records for a specific day only.

The date column is formatted as '2007-12-31' (yyyy-mm-dd) and includes a
time stamp 00:00:00.

But when I use "Filter & Sort" in Word, I cannot get it to filter by the
date at all.  No matter what varations of operators & values I try, it won't
filter the results.

I know I could create a View in SQL, but I'd like to find a Word based
solution.

Thanks for your input.
Kind regards
Stuart
Sydney, AUSTRALIA
Peter Jamieson - 07 Jun 2007 17:03 GMT
The trouble is that Word tries to generate the wrong syntax SQL code, then
gets confused (as far as I know).

Also AFIK, the only approach to a solution other than using a view is to
issue your own SQL in Word VBA, e.g.

ActiveDocument.MailMerge.OpenDataSource _
 Name:="the pathname of the .odc file you are using to connect", _
 SQLStatement:="SELECT * FROM [mytable] WHERE [mydate] = '2007-12-31'

Peter Jamieson

> Hi Guys,
>
[quoted text clipped - 16 lines]
> Stuart
> Sydney, AUSTRALIA
Stuart Troy - 16 Jun 2007 12:50 GMT
Thanks Peter,
I used a similiar solution, using the DATABASE field with an SQL query.
It works nicely.
Thanks again.
Stuart
Sydney, AUSTRALIA

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.