Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 07-26-2013, 05:52 AM   #1
matt2006
Newly Registered User
 
Join Date: Nov 2006
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
matt2006 is on a distinguished road
Unhappy Problem deleting records based on month

Hi Ive got a lot of help from this forum by just browsing through

But I'm at a dead end (I'm still kind of a newbie)

I want to write an sql or vba code to delete records based on the month:
For example I have a field called date which contains a date and I want to delete all Dates that are In April

Ive tried
Delete from LinkTable Where month(Date) = 'April'
Still Nothing

If anyone can put me out of my misery It would be appreciated

Thanks Matt

matt2006 is offline   Reply With Quote
Old 07-26-2013, 06:08 AM   #2
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 32,018
Thanks: 10
Thanked 3,859 Times in 3,802 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: Problem deleting records based on month

If you look in help, you'll see the Month() function returns a numeric value.
__________________
Paul
Microsoft Access MVP

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
The Following User Says Thank You to pbaldy For This Useful Post:
matt2006 (07-26-2013)
Old 07-26-2013, 06:13 AM   #3
matt2006
Newly Registered User
 
Join Date: Nov 2006
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
matt2006 is on a distinguished road
Re: Problem deleting records based on month

Quote:
Originally Posted by pbaldy View Post
If you look in help, you'll see the Month() function returns a numeric value.
thanks pbaldy, I overlooked that, its been driving me crazy so I missed the obvious

matt2006 is offline   Reply With Quote
Old 07-26-2013, 06:14 AM   #4
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 32,018
Thanks: 10
Thanked 3,859 Times in 3,802 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: Problem deleting records based on month

No problemo.

__________________
Paul
Microsoft Access MVP

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
Reply

Tags
date , delete , month , sql , vba

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting Records based on selections from another table NBVC Queries 11 04-01-2013 10:29 AM
deleting records based on info from another table edod1RES Queries 3 06-08-2012 12:05 PM
Deleting Records based on matching criteria maw230 Queries 9 02-17-2010 02:08 PM
Problem Deleting Records with ADO bdicasa Modules & VBA 2 08-25-2008 08:46 AM
Deleting Subform records based on Checkbox JVermast Forms 1 06-21-2005 07:33 AM




All times are GMT -8. The time now is 07:03 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World