I've asked a little about this before, and I've gotten some useful help. Here's what I'm doing. My overall goal is to create a line graph that plots certain data by month. It will plot Open Tags vs. Closed tags depending on the date parameters a user enters. (What Open Tags, etc. means doesn't matter.) But here's what I'm trying to do right now.
The user has already entered two dates into a form. (Sometimes only one date will be entered.) These dates have been stored in a main data table, in a format like 1/1/09. What I want to do is have these dates converted to months and years and then stored. For example, 1/1/09 would become 1/09 or Jan 09. I also need Access to recognize 1/09 as a date, or at least be able to recognize that 12/08 is before 1/09.
I suspect that eliminating the day part of the date will be easy. (I've found a number of different ways to format dates, but I haven't been able to find this one. So if you know how to do this, please tell me!) But I'm not sure whether I should use a table or a query to format the date. It seems obvious that I should use a query, but I have a lot of other things for a query to do after getting the date formatted.
Specifically, after the date gets formatted, I need the query to look at the dates entered by the user and, for each month in the parameters entered, the query needs to calculate how many tags were open during that month and how many were closed. (For instance, if the user enters the date parameters 1/09 and 12/09, the graph will plot open vs. closed tags for each of these 12 months.) The data is cumulative, hence the need for Access to recognize that 12/08 is before 1/09.
So I have two questions: (1) How to format a date like 1/1/09 into one like 1/09 so that Access still recognizes this as a date. And (2) Should I do this with a table or with a query?
Thanks for the help.
The user has already entered two dates into a form. (Sometimes only one date will be entered.) These dates have been stored in a main data table, in a format like 1/1/09. What I want to do is have these dates converted to months and years and then stored. For example, 1/1/09 would become 1/09 or Jan 09. I also need Access to recognize 1/09 as a date, or at least be able to recognize that 12/08 is before 1/09.
I suspect that eliminating the day part of the date will be easy. (I've found a number of different ways to format dates, but I haven't been able to find this one. So if you know how to do this, please tell me!) But I'm not sure whether I should use a table or a query to format the date. It seems obvious that I should use a query, but I have a lot of other things for a query to do after getting the date formatted.
Specifically, after the date gets formatted, I need the query to look at the dates entered by the user and, for each month in the parameters entered, the query needs to calculate how many tags were open during that month and how many were closed. (For instance, if the user enters the date parameters 1/09 and 12/09, the graph will plot open vs. closed tags for each of these 12 months.) The data is cumulative, hence the need for Access to recognize that 12/08 is before 1/09.
So I have two questions: (1) How to format a date like 1/1/09 into one like 1/09 so that Access still recognizes this as a date. And (2) Should I do this with a table or with a query?
Thanks for the help.