Jessica
You're right. Now() would use today's date. You need to use the incident date like you said.
-Bill
---In MS_Access_Professionals@yahoogroups.com, <hobackjessica@yahoo.com> wrote :
---In MS_Access_Professionals@yahoogroups.com, <hobackjessica@yahoo.com> wrote :
---In MS_Access_Professionals@yahoogroups.com, <hobackjessica@yahoo.com> wrote :
Thank you Bill. I thought Now() would use the date the query is being run rather than the date the incident took place. It's important I have a person's age at the time of the incident, not their current age.
And thanks for the tip on the apostrophe - fortunately my database is small and I only had to change two places.
Jessica
On Tuesday, May 27, 2014 12:28 PM, "wrmosca@comcast.net [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:
Jessica
Just make that change. Substitute your date field [DOB],[IncDate] for Now()
And you don't have to worry about the formatting of the SQL. Most of us who work with SQL have formatting software. By the way, you should not use apostrophes in field or table names. You should change all of those names now before you run into serious trouble. One example is Subject'sName
To make the changes in tables, queries, forms and reports download V-Tools for your version of Access. it's at http://www.skrol29.com/us/vtools.php It has a tool called Deep Search. It will help you find and replace all occurances of a name.
-Bill
---In MS_Access_Professionals@yahoogroups.com, <hobackjessica@yahoo.com> wrote :
Bill, I have the date set to calculate the age at the time of the incident, not today. We need to know how many "suspects" were juvenile versus adult at the time of the contact. Is there a better way to write that?
I agree with Liz that the query is scary but, in my defense, it looks a lot better in query design mode rather than SQL.
Jessica
On Tuesday, May 27, 2014 10:57 AM, "wrmosca@comcast.net [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:
Jessica
You might also want to change your Age calculation to something a bit simpler.
DateDiff("yyyy",[DOB],Now())+Int(Format(Now(),"mmdd")<Format([DOB],"mmdd")) As Age
-Bill
__._,_.___
Posted by: wrmosca@comcast.net
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (14) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar