Duane
I do have that type of query in one query, using that query in another query where i am matching that query up with an list of patients with Hypertension where I use the CDate field in the new query, but need to limit it to an age less than 85. when I enter in a criteria using date format I get an error message, when I enter in a text format (what the original field is) i still get a data missmatch error.
thank you
---In MS_Access_Professionals@yahoogroups.com, <duanehookom@...> wrote :
Patty,
I'm not sure what you mean by "text format". I assume what you posted was part of a query.
I would think something like this might work:
SELECT dbo_person.person_id, dbo_person.person_nbr, dbo_person.last_name, dbo_person.first_name,
CDate(Left([dbo_person].[date_of_birth],4) & "-" & Mid([dbo_person].[date_of_birth],5,2) & "-" & Right([dbo_person].[date_of_birth],2)) AS date_of_birth
FROM dbo_Person
WHERE CDate(Left([dbo_person].[date_of_birth],4) & "-" & Mid([dbo_person].[date_of_birth],5,2) & "-" & Right([dbo_person].[date_of_birth],2)) BETWEEN #1/1/1980# AND #12/31/1989#;
Duane Hookom MVP
MS Access
________________________________
I'm not sure what you mean by "text format". I assume what you posted was part of a query.
I would think something like this might work:
SELECT dbo_person.person_id, dbo_person.person_nbr, dbo_person.last_name, dbo_person.first_name,
CDate(Left([dbo_person].[date_of_birth],4) & "-" & Mid([dbo_person].[date_of_birth],5,2) & "-" & Right([dbo_person].[date_of_birth],2)) AS date_of_birth
FROM dbo_Person
WHERE CDate(Left([dbo_person].[date_of_birth],4) & "-" & Mid([dbo_person].[date_of_birth],5,2) & "-" & Right([dbo_person].[date_of_birth],2)) BETWEEN #1/1/1980# AND #12/31/1989#;
Duane Hookom MVP
MS Access
________________________________
> To: MS_Access_Professionals@yahoogroups.com
> From: MS_Access_Professionals@yahoogroups.com
> Date: Wed, 4 Feb 2015 10:19:07 -0800
> Subject: [MS_AccessPros] sorting off prior date conversion
>
>
>
> I am trying to pull information matching up my person table where we
> did a date conversion formula on it with a diagnosis table to give me
> the list of patients with the identified diagnosis but within a date
> range in the date of birth. we used this conversion (see below) based
> on a date that was a text field of a date. I tried to use the "text"
> format for the date as well as the normal date format but it gave me
> data missmatch error. How do I now work with this date format?
>
>
> dbo_person.person_id, dbo_person.person_nbr, dbo_person.last_name,
> dbo_person.first_name, CDate(Left([dbo_person].[date_of_birth],4) & "-"
> & Mid([dbo_person].[date_of_birth],5,2) & "-" &
> Right([dbo_person].[date_of_birth],2)) AS date_of_birth
>
> Thank you for all of your help
>
> Patty
__._,_.___
Posted by: pattykf@cox.net
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (5) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar