Modules & VBA :: WeekVal -> First Day Of Week For Current Year

Feb 10, 2015

Given a specific week no. for the current year... I need to return the first date of that week....

For example : week4 of this year (returns) 19/1/2015

View Replies


ADVERTISEMENT

Calcute Week Numbers Starting From 1 July Of Current Year

Feb 13, 2007

Hi everyone,

I want to calculate the week number of a date in a year starting from the 1 July (of the current year) - as this is the beginning of the Financial Year in Australia.

The starting day of the week is Wednesday.

I've been trying to think how I could use the Access DatePart Function in a query to calculate the week number from sales records.

I have had no trouble calculating the week number from the 1 Jan using the DatePart function. However, the function doesn't allow me to select a different date other than the first week of January.

So as a work around, I've thought of calculating the week number of 1 July in the current year, and just using the DateAdd function to add the week number to the week calculated by the DatePart Function.

Not quite working yet. Here's what I've come up with so far.


WeekNumberCount: DatePart("ww",[DateCalled],4)

I use the following to calculate the "my" starting week of the year:

StartingWeekInYear: DatePart("ww",DateAdd("ww",0,"1-July-" & Year(Date())),4)


Then I add the two together together:

MyWeekNumberCount: DatePart("ww",[DateCalled],4)+DatePart("ww",DateAdd("ww",0,"1-July-" & Year(Date())),4)


I know it needs some work to be useful for all years. Any suggestions?

View 3 Replies View Related

Sum Of Current Year Minus The Year Of A Date In Past?

Apr 25, 2014

I'm trying to add a couple of fields to the Contact database in Access 2010.

In the Contacts table, I created a field called "Sobriety Date" that has dates formatted like 12/27/1995

I am trying to add a calculated field called "Years Sober" which should be the current year minus the year in the 'Sobriety Date' field (1995 in the example above).

I have been trying to tweak this:

SUM(DatePart("yyyy",[Date]) - DatePart("yyyy",[Sobriety Date]))

but it's not working. Keeps giving me "The expression that you entered is not valid for web-compatible calculated columns"

View 2 Replies View Related

When The Last Week Of The Year And The First Week Of The Next, Are The Same!

Mar 18, 2006

I have the following expression which works nicely to group all of my dates into their respective weeks of the year, by week dates beginning Mondays:

WeekStart: ([MyDateField]+1)-DatePart("w",[MyDateField],2)

However, since the week beginning 12/26/05 crosses over both '05 and '06 (as week 53 and week 1), I get two groups of dates recorded for the week of 12/26/05 when I run my query.

Since my chart is based on weekly totals, I can't have two separate totals with the same 'week beginning' date.

How can I adjust my code to get one total group of dates for the week of 12/26/05?

Help greatly-needed!....

View 1 Replies View Related

Leading Zero In Week Of Year

Jan 8, 2007

I am using the format below to give me Year-WkNo and the leading zeros are not being put in so when a report is ran the yyyy-ww is not sorted correctly. Is there a way to get Jan 2007 week 1 to come out 2007-01?


YearMonth: Format([F Jobs Stats_sub2].[MaxofWork_Date],"yyyy-ww")

Thanks,
Greg

View 2 Replies View Related

Sort Date Formatted As Year And Week

Dec 7, 2004

I have a table with sales by day. I want to display the data in a graph summarised by week but the period spans several years. If I format the date thus Format(MyField,"yyyy ww") then Access sorts the results thus 2003 1, 2003 10, 2003 11 but it should be 2003 1, 2003 2, 2003 4 etc.

How can I get Access to sort in ascending order correctly on the formatted date?

Thanks

View 2 Replies View Related

Queries :: Week Number Query When Year Changes

Feb 28, 2014

I analyse things by the date they are ordered by the office.

The date gets put into a spreadsheet and i import this into access for the querying.

I need to summarise it by weeknumber and year.

I use the following queries:

To get the week: Week Number: DatePart("ww",[DateOrdered],0,2)
To get the year: Year: Year([DateOrdered])
To put it together: Weekyear: [Year] & "_" & [Week Number]

The problem is when the year changes.

The dates for week 1 for 2014 are between 30/12/2013 and 05/01/2014 and therefore straddles 2013 and 2014.

Therefore when the year and week number is put together the following results are given for that particular week:

DateOrdered - Result of above query
30/12/2013 - 2013_1
31/12/2013 - 2013_1
01/01/2014 - 2014_1
02/01/2014 - 2014_1
03/01/2014 - 2014_1
04/01/2014 - 2014_1
05/01/2014 - 2014_1

All of the above should all read 2014_1 but some obviously are 2013_1. This causes me problems when doing further analysis and cross tabulations.

How can I amend my query so that the above all show the correct year and week number: 2014_1 ?

View 9 Replies View Related

Date Query (last Week, Last 2 Weeks, Last Month, Last Year, All)

May 31, 2007

Hi

Would be great if I could get some help on this:

I have big table that gets updated almost every day with new data. There is a date column. I have a Form where I can enter queries. I need to add a panel where I can spcify if the query should involve the data should involve the date from last week only, from the last 2 weeks, from the last month or if the query should involve the overall data.:confused:

It somhow need to be check what the date is today and then caclulate back.

Any help on this would be much appreciated.:D

Thanks
Daniel

View 6 Replies View Related

All Orders In Current Week

Nov 4, 2006

Hi I am looking for a formula for my query which filters out only the orders raised in the current week.(5day week Monday to Friday) I did not want to enter dates manualy.
Can this be done ?
Can anyone help me with this.

Tks

View 3 Replies View Related

Week Number Of The Current Month

May 24, 2005

Hello everyone.

I would like to ask for help on my current problem.

I need to input a date on a text box and another text box say txtweeknumber should determine the week number the date falls on the current month.

for example:

May 1, 2005 should fall on week 1 and txtboxweeknumber should say Week 1
May 9, 2005 should fall on week 2 and txtboxweeknumber should say Week 2
May 17, 2005 should fall on week 3 and txtboxweeknumber should say Week 3
May 25, 2005 should fall on week 4 and txtboxweeknumber should say Week 4
May 30, 2005 should fall on week 5 and txtboxweeknumber should say Week 5

Same goes for all months.
Is there a function to determine which week number of the current month the input date falls?

Please help.

Thanks,

Edwin

View 2 Replies View Related

Set Default Value To Monday Of Current Week

Aug 21, 2005

Hi,

I'm wondering how to set the default value of a combo box to the Monday of the current week (it's grabbing a date field).

Many thanks in advance.

View 2 Replies View Related

Viewing Data By Current Week

Jan 26, 2006

I'm a bit new at all this but am trying to produce a query that filters on dates within the current week. Is there any way of doing this? I now how to do it for the day but at the moment I'm having to manually input 2 dates to get data in between them. Is there a command that will automatically detect the week and pull up dates within that?

View 8 Replies View Related

Queries :: Count By Current Week

Dec 26, 2013

Curretnly I have a query setup with Area, EventDate, & Complete. I want to be able to count each occurance of complete in current week. So far I have the following criteria under EventDate.

DatePart("ww",[EventDate])=DatePart("ww",Date()) And Year([EventDate])=Year(Date()).

So, this does in fact get me the records of current week, the issue I'm having is when an area has occurences daily. It will not bulk that area into a weekly count. I just need to be able to see how many occurances happen in the week total not daily. So my results could be.

Office1 5
Office2 1
Office2 1
Office2 1
Office2 1
Office2 1
Office3 5

View 2 Replies View Related

Current Week Query In 2 Date Feilds

Nov 17, 2006

I have a query with below formular which return's all records between Sunday and Saturday

Between Date()-Weekday(Date())+1 And Date()-Weekday(Date())+7

I can get this formular to work when it is looking at one date feild. (Date Received). I would also like it to look at the (date completed) feild so I get all records entered & completed in the previous week.
I have tried putting same formular in the OR critiria as well but cannot get it to show all records at same time.
What am I doing wrong ???

Tks

View 1 Replies View Related

Reports :: Query To Show Only Current Week

Dec 3, 2014

How can i make a conditional report that can give me some data from the table.

View 1 Replies View Related

Queries :: Unable To Get Current Week Number

Jan 10, 2014

I need to a query on the week number, the week number is in the table. Imjust struggling with getting the current weeks data.

View 10 Replies View Related

Query Criteria To Display Current Week Only?

Jan 23, 2012

I have a database that lists jobs that need doing, in the jobs table there is a Deadline field, this is a Date Time field that specifies when a job must be finished by.

So I'm trying to make a query, using my limited knowledge, that displays all jobs that need finishing between todays date and the rest of the week.

So I tried this and got nowhere:

Between #(Date())# AND #(Date()+7)#

View 4 Replies View Related

General :: Add A Field Which Returns Day Of Week From Current Date

Jul 5, 2012

Having a bit a brain freeze today. I have a field that auotmatically puts a date in when a checkbox is checked I am now trying to add a field which returns the day of the week from this date. Brain now mashed I am sure it's pretty simple but I just can't get it to work

View 5 Replies View Related

Detecting The Current Year?

Sep 22, 2006

Hello.

Just wondering if there was a way to detect the current year? (2006, obviously). Reason being, have an input date of year a block of trees was planted and i want to have an automatic calculation for the 'age of trees'.

Thanks!

View 4 Replies View Related

Amount For Current Year

Jun 2, 2005

Hi All.
I need to generate a query which will show me in Field1 Cost for the current year only and in Field2 Cost from a start date to the current. If is it possible how to do it?
Thanks.

View 1 Replies View Related

Forms :: Getting Monday And Friday Of Current Week On Main Menu?

Jan 3, 2015

For some reason i'm having difficulty getting the Current Monday and Friday of the Current Week on my Main Menu. Monday shows 12/29/2014 ???

Here is the code for the scenario.

Monday: =CDate([AnyDate])-(Weekday(CDate([AnyDate])))-2+4+3-3
Friday: =Date()-(DatePart("w",Date(),2,1)-1)+4

AnyDate: Date()

View 8 Replies View Related

View Only Records Of The Current Year

Dec 19, 2006

The solution might be in front of my nose but I cannot see it... I have a query with all my records I need to extract only records of the current year, so that now will show all 2006, as we enter into the following year it will show all the 2007.
What is the criteria I should put into the "Date" field I have?
Thanks

View 2 Replies View Related

Using A Button To Add A Year To The Current Date.

Jan 26, 2006

Hello,
i have an expiry date for my members and each year they need to renew it, so i would like to have a button that when clicked adds 1 year to the date.

I currently have this query
=DateAdd("yyyy",1,[Commenced Training])

as there membership will expire one year from their joining date.
this is currently shown for hte text box expiry date.

however i cannot work out how to make another one for the button so that when the button is pressed it adds another year and stores its.

the image shows my example

thanks

View 2 Replies View Related

How To Set Autonumber With Current Year As Initial Value

Jun 30, 2013

I want access to generate for me an autonumber, but with the current year as initial value. ( To give new hired employees a unique number). For example, we are now in 2013

If there a new hire, that employee is going to get a unique number 2013001

The next new hire, will get 2013002 and so on

I know how to append a table to set the initial value, but this means, that next year I will have to append a new table again to set the initial value to 2014.

I want access to do this automatically for me, so that next year a new hire will get the unique number of 2014001, the next one will be 2014002 etc...

View 4 Replies View Related

Reports :: Edit Current Report That Lists Production In Week Number Order?

Feb 26, 2015

I've been asked to edit a current report that lists our production in week number order. I need to look at way we can 'flag up' orders that are within a 4 week period from the current date.

For example,

10 Orders in total in our database. 5 of which are due the drawings back within 4 weeks from today (26/02/15). I'm looking for a way for the report to show the 5 orders as priority, either by formatting the orders in bold, a different colour or under their own heading/group.

View 14 Replies View Related

Forms :: Limiting Continues Form To Accept 7 Lines And Dating Them With Current Week?

Jul 29, 2013

Form info

1st Form Name: Mainform
Text to enter employee ID : empid

Sub form within Mainform: SFTimesheet (continues form)
text to enter: Timein, Break, Timeout

SFTimesheet shows and accept entries for each employee called using the text empid, on the mainform

I wanted the subform to show 7 days /lines starting from Sunday to Saturday of current week and dating the text "Timein" accordingly. When employee enteres an entry on the 7th Line, it should give them a new 7 lines for the new week to begin.

View 5 Replies View Related







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