Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Stuart Troy Stuart Troy is offline
external usenet poster
 
Posts: 2
Default Filter Merge Data by Date Range

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
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Filter Merge Data by Date Range

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

"Stuart Troy" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Stuart Troy[_2_] Stuart Troy[_2_] is offline
external usenet poster
 
Posts: 3
Default Filter Merge Data by Date Range

Thanks Peter,
I used a similiar solution, using the DATABASE field with an SQL query.
It works nicely.
Thanks again.
Stuart
Sydney, AUSTRALIA


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
Mail Merge Prompt date range query Tianna Mailmerge 1 February 1st 07 06:52 AM
How do I print documents from a folder within a certain date range? jlawson Microsoft Word Help 3 January 3rd 07 06:34 PM
How do I change the date range on a calendar template in Word Jill Microsoft Word Help 3 March 23rd 06 05:05 AM
Date range LucasRU Microsoft Word Help 2 December 11th 05 11:02 PM
How do I filter a Dbase date field in a word mail merge documnet? SMATKINS Mailmerge 0 January 27th 05 04:09 PM


All times are GMT +1. The time now is 08:26 AM.

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"