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 Replies


ADVERTISEMENT

Year To Date Totals, Month To Date, Week To Date

Oct 9, 2005

Can someone tell me how to get year to date totals, month to date totals, week to dates in a query? I need to get all three for three different fields.

I was not able to get the totals with the formulas given. I received the totals for each day instead. Are there any other suggestions? I am trying to different formulas, but they are not working either. I did try doing different queries with the formulas to see if that would work.

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

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

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

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 2 Replies View Related

Reports :: Sort Week Starting On Wednesday

Sep 5, 2013

I have a report with a date field and want to sort it by week starting on Wednesday. I currently have the week starting on Sunday.

View 3 Replies View Related

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

Formatted Date Not Recognized

Feb 27, 2007

I am using this formula to format my date field

Convert this:A601030730 to 03-Jan-06

A6 = Year
01 = Month
03 = Day
0730 = Time (not worried about that part)

ApptDate: IIf([abap_030] Is Null,"",Format(DateSerial(Val(Mid(Left([abap_030],6),2,1)),Val(Mid(Left([abap_030],6),3,2)),Val(Right(Left([abap_030],6),2))),"dd-mmm-yy"))


I get the date to "Look" the way I want, but Access does not seem to recognize the formatting as it will not sort properly?

Any suggestion would be welcome, thanks

Ziggy

View 3 Replies View Related

HELP: Changing Dates To FY (fiscal Year) And YTD (year-to-date) Values

Apr 25, 2006

I have a huge table with transaction dates. I need to slice and dice
this data (sum, %'s, etc), but group by FY. Our fiscal year is from
7/1 thru 6/1.

For example:
1/8/2004 = FY 2004,
8/12/2004 = FY 2005,
2/3/2006 = FY 2006

THEN . . . . I need to also isolate certain periods, for example July-
March for YTD (year-to-date) analysis and compare YTD of 2006 with that
of 2005.

What do you suggest? Many thanks.

Mehran

View 7 Replies View Related

Sort Records Based On Fiscal Year

Oct 14, 2005

I would like to sort records based on fiscal year for a chart. The fiscal year would be 7/01/2003 to 06/30/2004. I would like to sort this based on oldest date to newest date. This query could span several fiscal years. Any help would be greatly appreciated.

View 7 Replies View Related

Queries :: Sort By Year Is Sorting By Month

Sep 16, 2013

I've created a query based on 2 other queries.

I then filter the results of the third query based on 2 dates.

This worked great for 2013.

As a test I started making some records for 2014 and I've now found that my third query is not filtering the dates properly.

The filtering is happening based on date fields that contain only month and year eg: "09-2013".

My problem is that when I try to filter for records in 2014 it brings up results for 2013 as well.

If for example I had a record in August 2013, September 2013 and August 2014.

The sort would be:

08-2013
08-2014
09-2013

NOT:

08-2013
09-2013
08-2014

How do I make the sort apply to month then year to get the correct results returned?

View 6 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

Queries :: Filtering On Value Of Formatted Date Field

Feb 22, 2014

I have a database with a table of employees, and that has a column named "DaysOff", into which I type a couple of days like this: "SUNDAY AND MONDAY"

Next, I have a form onto which I will display a query of those employees. The form contains a field called DATE in which I display the mm/dd/yyyy date. What I want to do is this:

I only want those employees that have a DaysOff field that DOES NOT CONTAIN the WEEKDAY NAME of the date in the DATE field. So, for instance, if the DATE field read 2/22/2014, and I have three employees as such:

Employee 1 DaysOff "Monday and Tuesday"
Employee 2 DaysOff "Friday and Saturday"
Employee 3 DaysOff "Sunday and Monday"

In that case, ONLY EMPLOYEES 1 and 3 should show up. Employee 2 will NOT show up, because his DaysOff field contains the word "Saturday", and the WEEKDAY FORMATTED value of the DATE field is "Saturday"

I hope that's not too confusing. Again, this needs to be the filter criteria for the query. That query will only return a list of employees that are NOT off on the day in question. If one of their off days is the day in question, the query won't return that record.

I've tried a few things, but I can't get it to work. If you want, I can list the various things I've tried, but I imagine one of you knows exactly how to do what I need to do, and you won't need my feeble attempts as a springboard.

View 2 Replies View Related

Queries :: Determine Date Given Day Of Year And Year

Jul 3, 2014

I have fields [DayOfYear] and [Year] can I somehow produce the dd/mm/yyyy from this. I know how to do it in Excel but the Asscess function Date() is a little different.

I.e. if [DayOfYear] =152, [Year] = 2014 then [Date] = 2/6/2014

View 6 Replies View Related

Year And Date - Show Day Of Year As Three Numbers

Jan 10, 2012

I'm going to try using the year, day of year, hour & minute (24 hour clock) as a report number. It's set up in a field on a table. Right now I have....

Default Value =Format(Now(),"yyyhhnn") 'which works but not exactly how I would like

yy = Last two digits of the year
y = Number of the day of the year (1 to 366) 'can this show three digits all the time?
hh = Hour in two digits (00 to 23)
nn = Minute in two digits (00 to 59)

For instance, right now for Jan. 10th, 2012, 1306 hours the result would be 12101304 which, for all intents and purposes works, but I would prefer the "day of the year" to always be represented by three digits and not just when it hits day 100 of the year.

I would prefer to see 120101304

View 4 Replies View Related

Queries :: Sort Out Invoices By Year - Query Based On Combo Box To Show All Records

Mar 4, 2015

I am trying to have a query sort out my invoices by year but also to have the possibility to show all invoices.

I have one table "INVOICE" where I have a column "YEAR" calculated with DatePart function from the invoice date.

On my form "INVOICE LISTING", I want to have a combox "Combo957" selecting the year. I have forced the "ALL" selection to the combox using a UnionQuery.

My problem, I cannot get the query to work. I have tried many ways, the closest I can get is :

IIf([Forms]![Invoice Listing]![Combo957]="ALL",([Invoice].[Year])<Year(Date()),[Forms]![Invoice Listing]![Combo957])

If I select the year from the combo, it works, if I select "ALL" nothing is shown.

here is the full SQL

SELECT DISTINCTROW Companies.Company, Companies.City, Companies.Country, Sales.Brand, Sales.Type, Sales.Date, Sales.QuoteNo, Sales.Delivered, Sales.Account, Sales.Branch, Invoice.InvoiceNumber, Invoice.InvoiceDate, Invoice.CustOrderNumber, Invoice.PaymentTerms, Invoice.DueDate, Invoice.NetAmount, Invoice.TotalAmount, Invoice.Tax, Invoice.PaiementRCVD, Invoice.Overdue, Invoice.Month, Year([Invoice]![DueDate]) AS DueYear, [Invoice]![month] & " - " & [Invoice]![Year] AS InvoiceMonth

[Code] .....

View 5 Replies View Related

General :: Create A Field With Start And Finish Date On Certificate Formatted Correctly

Aug 22, 2013

I am creating a access db for use with a training company. All is working great.

What I want to do is create certificates within Access and then print by the Course load. Easy enough and I can do this.

The courses usually last two or three days, so i want to create a field which has the start and finish date on the certificate formatted correctly.

I currently use this

Code:
CourseDate: DatePart("d",[StartDate]) & " & " & DatePart("d",[EndDate]) & " " & Format([EndDate],"mmmm") & " " & DatePart("yyyy",[EndDate])

within a query which returns this

29 & 30 May 2013

what i want to print on the certificate is this

29th & 30th May 2013

I need to have the 'st' or 'nd' or 'rd' or 'th' in the date.

View 3 Replies View Related

Add 1 Year To Year Part Of Date

Mar 14, 2006

I have a query based on payment date which I have extracted the Year part as a seperate Field StartYear, but I want to now add EndYear which just adds 1 year to the StartDate. e.g. EndYear = StartYear +1. Anyone kow please I know i's proably simple but I keep getting syntax errors.

View 3 Replies View Related

Queries :: Importing Excel File With Incorrectly Formatted Date Field - CVDate Partially Functional

Jul 22, 2015

I need to import an excel file with incorrectly formatted date field and it worked only to import them as text:

1 jan 2015
1 feb 2015
1 mar 2015
etc.

Using CVdate converts jan, feb, nov and dec to correct date, but gives an error message with mar to oct.

View 1 Replies View Related

Reports :: Report Won't Sort By Date When Query Contains Date Formatting

Jun 21, 2013

A few months ago I created a report that displays the results of a long union query comprising a dozen or so individual queries, each containing an expression that yields a date (or sometimes date and time). I set the report to group by query and then sort by the date expression. Now for some reason that I can't fathom the report has always only ever offered me the option to sort the date "A to Z", I infer it thinks the date is text, but this misunderstanding has never actually stopped it sorting by date perfectly well. It worked. No problems.

However I have recently added formatting to some of the queries so that they just display date, not date and time e.g. Format([dateandtime],"dd/mm/yyyy"), and now the sort by date in the report no longer works. None of the sorting or grouping options have changed, but it now sorts just by the "dd" component of the date - so it thinks 21st June is later than 20th July. why?

View 14 Replies View Related

Help To Convert Date To Week.

Aug 8, 2005

Hi,
I'm looking for a module wich converts a date to a week.
Ex: i type 08/02/2005 and i obtain Week #2
(Some years have 52 and other 53 weeks, depend on the date of the 1st week of the year, an other problem is that some people say the week begins the monday, other say it begins a sunday)
Maybe a built in fonction exists.
Thanks in advance for help.
VINCENT

View 9 Replies View Related

Week Starting With The Date ######

Mar 29, 2007

Ok,

I am making a database which has a set of lessons which have been booked for a particular date.

What I want to do is be able to have a pop-up box ask you for a date for the start of the week. e.g. I want to find lessons from the week starting 02/03/2007 for 1 week (e.g. 2nd - 9th), so I type in the box "02/03/2007" and it comes up with records from that week.

I have tried this in the criteria box:
[Enter date]+7
and
=Date([Enter Date])+7

But nothing works. Also, I decided to add a record with todays date, and then use the criteria =Date(), but that didnt work either!!!!

Help would be greatly apprecated :p

Thanks
Michael

View 3 Replies View Related

First Date Of A Week Number?

May 14, 2007

Hi Folks,

I use this to get a week number for a date range:

WeekNo: DatePart("ww",[Timestamp])

Is there a way that I could also get just the first date from that week number to appear in the query as well?

ie. if Week 1 is 3/1/07-3/7/07 the query would show 3/1/07 as well as week 1. TIA

View 1 Replies View Related

Entries With Date This Week

Nov 13, 2007

I set up the following code on the Expression Builder
Date() Or Between Date() And Weekday(6) Or <Date()
I want to get all entries of the rest of the week, but it is not working.
Can I set up Weekday(6)?
So if it is Monday i want to see all entries from Monday to Sunday and if it is Wednesday i want to See all entries between Wednesday and Sunday.
Could you please help me! thanks

View 5 Replies View Related







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