DESPERATELY In Need Of Help On Query Last 2 Years

Mar 5, 2008

Hi,

How do I query the last 2 years vs. current date?

Basically, I want to see the record from today date back to 2 years.

Please assist...

Thanks,
Isabel

View Replies


ADVERTISEMENT

Modules & VBA :: Getting Age In Years With One Decimal Place (3.5 Years)

Mar 24, 2014

I have a table that lists computers I want to know the age of them for replacement purposes. I am using this function to populate a textbox on a form that updates my table. the results I am getting is a negative whole number I would like to get a positive number with one decimal place. so if computer was shipped September 24, 2010 my textbox would say 3.5 not -3

Here is my function

Code:
Private Sub Form_Load()
Dim theDate As Date
Dim age As Integer
theDate = Nz(Me.compDate.value, 0)
If theDate > 0 Then
age = DateDiff("yyyy", Now(), theDate)
Me.compAge = age
End If
End Sub

View 4 Replies View Related

Years Query

Oct 2, 2007

Hi,

I would like to be able to run a query that lists the number of years members have been subscribing (up to the current year).
i.e. to show the year he joined, and how many years he has been a member (shown as a number).

Is there a way to do this easily?

thanks

Adrian

View 2 Replies View Related

Please Answer Need Help Desperately

Apr 19, 2006

I have created a basic database but now need it to perform some difficult tasks (Well difficult to me) an havent a clue how to do this.

I need to be able to search the database for a vehicle type for a specific dat to see whether it is available or not?

and i need to be able to produc a list of vehicle & drivers that are not booked by entering a date?

Has anybody got any ideas on how to do this because its racking my brains

Thanks

View 4 Replies View Related

Help Desperately Needed

May 2, 2007

After working on a clients website, he decided to challenge me... He has an access database that needs editing, but I've never used MS Access before.

Half the fields on his Customer Order form are redundant, and needed removing, which I have done. I am getting no error messages, so I assume that everything has gone according to plan.

HOWEVER... He also wants me to add an area at the bottom of the same form, that will show a list of all his agents within a 20 mile radius of a given postcode (ie, the customers).

Anyone know if this is possible, and if so, how?

View 2 Replies View Related

Newby Needs Help (desperately)

Jun 9, 2005

I have this form which shows the contents of a table... however, this table is linked to another table. How do I show the results of this linked table in the form?

Table_person
- Table_personID
- PersonFirstName
- PersonLastName
- EmployerID (linked to table below)

Table_Employer
- EmployerID
- FirmName
- ....

Now - the form should look like this:
First name: John
Last name: Doe
Firm: John Industries (selected in a dropdown box)

Table_Employer would contain
1 John Industries ...
2 Hank Industries ...

You catch my drift right?
How do I link these two tables in a form? How do I get the correct Firm to be selected in a dropdown box?

Any help is appreciated!!
Jazz

View 7 Replies View Related

DCount Help Desperately Needed

May 10, 2006

:confused:
I have a table, that records various information about cartons by date and lane and carton type and product type for those cartons. In the lane fields, there is 11 of them, it records the number of cartons with specific issues (tears, globs and fallbacks). I am trying to run a query that will count the number of cartons that have those issues on any given day, in each lane. I have used the DCount function, however, it still counts the cartons that have 0's in those fields. For example, one particular date, there were 18 entries, so no matter what I do for the DCount function, it still comes back with 8 instead of 1 issue in lane 1. I have been fighting with this for weeks! Please help!!!

View 5 Replies View Related

Desperately Needed Code

Dec 28, 2004

Hi,
I have a database that has a combined user last name, user first name and user middle initial all in one field called name.

Example:

NAME
DOE JOHN I.
SMITH JOHN R.

I would like to get a code that will look at the field and separate them in three different fields, such as :

LNAME
DOE
SMITH

FNAME
JOHN
JOHN

MI
I.
R.


I would really appreciate any help.

Sincerely,
Monti

View 2 Replies View Related

My Query Stopped Working After 3 Years???

Apr 25, 2005

I have a burron to run a query that auto populates 'start time' with NOW().
It has worked for 3 years and now I get an error message see attached. The only thing I did was change the program fromm 2000 to 2002.

any and all suggestions welcome.

Thanks

View 2 Replies View Related

Query Weeks Over Multiple Years

Aug 17, 2005

I have a database that I am using to report metrics based on seasonally available data. What I am running into is the problem that the seasonally entered data doesn't start on the same date every year.

An example:
I have data that was entered into my database last year starting July 26, 2004. This is considered part of week 1 of my season and I want to compare that data to records that started being entered on August 15, 2005. Which is week 1 of the 2005 season.

Records include the following information: id, date, other irrelevant details

Does anyone have any ideas on how I might be able to accomplish this? Thanks in advance for your help!

View 1 Replies View Related

Calculate Employment Years In Query?

Feb 8, 2005

I'm trying to calculate the amount of years employed in a query and I keep getting "Data Type Mismatch in criteria expression".

I'm putting the expression in the YearsOfService Field that I've created that I would for the total in years to populate.

Here's the field expression:
DateDiff("yyyy",[EmpHireDate],Date())+(Date()<DateSerial(Year(Date()),Month([EmpHireDate]),Day([EmpHireDate])))

Thanks for any help...

FYI EmpHireDate is a Date/Time Field and YearsOfService is a Number field

Thanks for any help...

View 12 Replies View Related

Queries :: Putting Total Years In A Query?

Sep 25, 2013

I have a database of people who have a "Joined" date. i.e. 09/1/2012. I would like to set up a query that tells me how long (in years) that they joined.

View 5 Replies View Related

Queries :: Parameter Query Criteria To Return Dates With 2 Years Remaining

Sep 17, 2013

I am trying to create a parameter query to return dates that have 2 years remaining.

For example I have dates for when mortgages expire, and I want to recognise the dates that have two years remaining using a parameter query but I can't figure out if I use DateAdd or DateDiff.

View 2 Replies View Related

Add Months And Years

Oct 29, 2007

Hello mates, :cool:

I'm a bit confused with date codes. What I'm try to complish here is that how to add years and months from separate fields to text box, where's difference between two dates as an years and months? So basicly first I read year and month values from text boxes to a integer and then I'm going to add them to somewhere at last, but I'll get like 1 year and 14 months for result so, could you hit me with some tips or tricks what I should try out.
I'll approciate your time to help me out with this and thanks for advance. =P

View 1 Replies View Related

Working With Years (please Help!)

Feb 14, 2007

Firstly, when designing tables, how can I format Date/Time to just the Year? I've tried syntax yyyy, but when I enter a year after opening the table, I get a type mismatch error.

Secondly, providing I have the correct custom format for Year, how can I enter the following dates?
1744-1745
Circa 1925
Before 1690
1800s

And would I be able to run queries on them, showing the dates in ascending order?

Any help would be much appreciated!

View 2 Replies View Related

10 Consecutive Years

Dec 5, 2007

I have atable the is storing ID, attendance_year and meeting code. Iw ould like to query the table and identify the IDs that have 10 consecutive attendance years no matter when it may have occured. So IDs have more than 10 row of data but not necassrily 10 years in a row.

How can I do this?

table looks like

123|2003|WIN03
123|2001|SUM02
456|2001|WIN01
456|2000|WIN00
456|2002|SPR02
456|2006|SUM06

View 5 Replies View Related

Happy New Years

Dec 31, 2004

Happy New Years guys, all the best. hope the year will be good to us all.

View 1 Replies View Related

Sum - Two Years In Different Fields

Oct 31, 2006

How do I set up a query to sum data separately by year in the same row of data? I would like to see on one row a sum for year 2005 and also a separate field to sum for 2006.

Help me please!

EWJRichardson

View 4 Replies View Related

Same Data Many Years = Confused!

May 10, 2005

I’m after some database advice. It will probably be something simple I can’t see for the wool…

I’m putting together a database that describes specifis small area geographies (Scottish Census output areas). For small area there will be various training category variables with associated counts and a general cost for all training in that geography. On its own this isn’t really a trouble but the database will grow over time with the same data (more or less) appearing each year to add to the database. I have a master geographical index that is used to aggregate small area data to higher areas so I could :-

- have a series of year based tables linked through the small area field and queried on a year look up basis.
- store each years data into the same table as the last and use a year identified to separate the records
- add new fields for all variables for each year across one table although once the number of fields reach 255 or so it would fall to bits.

I think the third is the worst option but I really would be grateful if anyone had any thoughts you could share with me on the best design approach to take.

Any help gratefully received!

Thanks...

View 1 Replies View Related

Multiple Years Data

Aug 22, 2005

Need some help figuring out the best way to handle this.
I have one table - tblEngineVolumes which has columns for each month Jan-Dec for the year 2005 with fields for each printer type.

Type Jan Feb Mar.....
PrinterA 100 50 300
PrinterB 500 25 250

I now have to figure out a way to have both 2005 and 2006 volumes for each printer.

My option so far is are below (there will never be any more than 2 years involved)

Type Jan 05 Jan 06 Feb 05 Feb 06
PrinterA 100 150 50 60
PrinterB 500 400 25 35

OR

Type Year Jan Feb
PrinterA 2005 100 50
PrinterA 2006 150 60
PrinterB 2005 500 25
PrinterB 2006 400 35

Would appreciate any thoughts/suggestions

Thanks,

Toni

View 2 Replies View Related

Calculating Fiscal Years

Dec 4, 2007

Hi,

I have the following function:

Function GetFiscalYear(ByVal x As Variant)
If x < DateSerial(Year(x), FMonthStart, FDayStart) Then
GetFiscalYear = Year(x) - FYearOffset - 1
Else
GetFiscalYear = Year(x) - FYearOffset
End If
End Function

I call on the function in my query to determine the FiscalYear for a date.
Expr1: GetFiscalYear([ProdDate])

It sends back the correct Fiscal Year. However, when I try to put criteria in for Expr1 to show only Fiscal Year 2007 instead of all fiscal years, it gives me a data mismatch type error.

The [ProdDate] has the following formula:
Prod_Date: IIf([40Day]="True",DateAdd("d",-40,[Date Code]),DateAdd("d",-50,[Date Code])) where [40Day] returns True or False to determine if I should subtract 40 or 50 days from the Date Code. The Date Code is in the format ##/##/#### and is sometimes null.

I have tried everything I could think of and am completely stumped. Thanks in advance for any help!!!

View 2 Replies View Related

Drop Down List Of Years

Oct 11, 2005

Hi folks,

I want to populate a drop down combo box with a list of 10 years (current year +/- five years). I can enter them as a Value list but I don't want to have to update the list every year. Neither do I want to allocate a table to maintain a list.

Any ideas as to how I can auto populate the combo with a 10 yr span (5 previous and 5 next) and default to current year?

Thanks,

Dave

View 9 Replies View Related

List All The Years In A Combo Box

May 20, 2006

I hope someone will be able to help....

I have minimum year and maximum year value (for example 2006 is minimum & 2009 is maximum. How could I get a combo box to display all the years within the range of the minimum and maximum year (in this case, it should give me an option of 2006, 2007, 2008, 2009).

FYI - This database is used to track projects and each project has a commencement date and an estimated completion date. the minimum year is derived from the commencement date and the maximum date is derived from the estimated completion date. I am building a search form whereby the year selected in the combo box should display all the projects commencing, continuing, and ending that year.

Pls help...

Thanks in advance.
jan :confused:

View 8 Replies View Related

Calculate Age In Years And Months

Feb 8, 2005

I need a formula or a function that will return a person's age in years and months. All the functions and formulas that I have seen to date and that I have used only calculate a person's age in years. Can anyone help?

View 2 Replies View Related

Counting Years Between Dates

Jan 25, 2006

Friends,

I have a form with four fields, date1, date2, date3 and date 4.
These have all a mm/dd/yyyy format.
I need to add an unbound control which will count in months and years the difference between the dates.

Ex.
date1: 01/01/1970
date2: 05/05/1980

date3: 06/06/1990
date4: 06/30/2001

Fields date3 and date4 may be blank, therefore the code should consider only counting the first two.

Thanks for any help.

View 14 Replies View Related

Calculating Years And Months

Jan 5, 2007

Hi,

i have a displayed(textbox) birthdate (txtDoB) and a textbox "input_date" (txtInputDate) inside form "form Two".

how do i calculate the years and months difference upon clicking the "OK" command button at "form Two"?

the result of the years and months will be displayed at a textbox (txtResult) at a form called "form Result".

thank you.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved