MDB File & Date

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
HolyAbsolut
Newbie
Posts: 17
Joined: Wed Sep 21, 2011 10:28 am

MDB File & Date

Post by HolyAbsolut » Wed Jan 16, 2013 9:58 am

Hello @ all,

I'm tying to get a automatic reminder for Birthdays from are "MDB" file
The dates are saved into a colum which is also formated as "Date"

As only need to check if Month and Day I tried to use following command
Select * from [Adressbook] WHERE DatePart("m",[Birthday]) = 01 AND DatePart("D",[Birthday]) = 16

This one works fine if I use MDB Viewer Plus. But unfortunally it does not work with Macro Schedular.

Do you know an advise how I can get this work.

Best regards

HolyAbsolut

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jan 16, 2013 12:32 pm

I think DatePart is an Access/VBA function. It therefore has no context in an SQL query made outside of Access.

Here's an idea: Create a query in Access which chucks out all columns from Addressbook as well as two extra columns which chuck out DatePart("m",[Birthday]) and DatePart("D",[Birthday]). Call these BirthDayMonth and BirthDayDay for example.

Then in your Macro Scheduler SQL query this query instead:

Select * from [YourQueryName] WHERE BirthDayMonth = 01 AND BirthDayDay = 26

Simpler.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

HolyAbsolut
Newbie
Posts: 17
Joined: Wed Sep 21, 2011 10:28 am

Post by HolyAbsolut » Fri Jan 18, 2013 6:17 am

Hello,

Thanks for your support.

I have done as you decribed an d it works.

Thanks.

Best regard

Maximilian Braun

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts