Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 08-17-2015, 10:23 AM   #1
ALewis06
Newly Registered User
 
Join Date: Jun 2012
Location: Atlanta, GA
Posts: 124
Thanks: 36
Thanked 6 Times in 6 Posts
ALewis06 is on a distinguished road
Question Convert 3-char month & year to Date

I have 2 columns that are listed as such:

AssumptionMo AssumptionYr
MAY 2014
JUN 2015
JUL 2015
OCT 2016

I need to create a field called AssumpDate that converts the month into a date field on the 1st day of the month. ex May 2014 needs to read 5/1/2014. When I use the expression AssumpDate: DateValue("1-" & [Assumption_Month] & "-" & Year(Date())) of course the year changes to the current one--2015. How can I I change the expression so that the year is based on the AssumptionYr column?

ALewis06 is offline   Reply With Quote
Old 08-17-2015, 10:35 AM   #2
plog
Banishment Pending
 
Join Date: May 2011
Posts: 9,403
Thanks: 11
Thanked 2,282 Times in 2,234 Posts
plog is a jewel in the rough plog is a jewel in the rough plog is a jewel in the rough
Re: Convert 3-char month & year to Date

Well, since your code shouldn't work to begin with, I don't know.

Your expression uses [Assumption_Month], but the columns you listed in your sample data is AssumptionMo.

Which is it? Also, you seriously haven't played around with your expression to see if you could get it to work?
plog is offline   Reply With Quote
Old 08-17-2015, 10:39 AM   #3
ALewis06
Newly Registered User
 
Join Date: Jun 2012
Location: Atlanta, GA
Posts: 124
Thanks: 36
Thanked 6 Times in 6 Posts
ALewis06 is on a distinguished road
Re: Convert 3-char month & year to Date

I meant to name the column AssumptionMonth of course, not AssumptionMo. I am indeed playing around with it now. Thank you

ALewis06 is offline   Reply With Quote
Old 08-17-2015, 10:47 AM   #4
ALewis06
Newly Registered User
 
Join Date: Jun 2012
Location: Atlanta, GA
Posts: 124
Thanks: 36
Thanked 6 Times in 6 Posts
ALewis06 is on a distinguished road
Re: Convert 3-char month & year to Date

Quote:
Originally Posted by plog View Post
Well, since your code shouldn't work to begin with, I don't know.

Your expression uses [Assumption_Month], but the columns you listed in your sample data is AssumptionMo.

Which is it? Also, you seriously haven't played around with your expression to see if you could get it to work?
No wonder you asked if I had played around with it; I made the ridiculously simple seem hard. Thanks

ALewis06 is offline   Reply With Quote
Reply

Tags
convert date , date , text to numbers

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sales this month or year verses last years month or year Blitznb Reports 8 01-05-2012 01:43 PM
Year to date totals, month to date, week to date msquery Queries 9 06-02-2010 11:52 PM
Convert yeardays to year-month-day raducu76 Queries 2 11-14-2008 11:07 AM
Date - Month and year only Janjang General 3 12-19-2005 08:15 PM
Month and Year to date jonwentz Queries 2 10-01-2004 06:33 AM




All times are GMT -8. The time now is 07:57 AM.


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

Featured Forum post


Sponsored Links


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