Can anyone post any code that will count the number of elapsed days in
a year? I want code that tells me 1/1/2004 is day 1, 2/1/2004 is day
32, etc.
I plan to use this in a calendar that caculates people's birthdays
from today's date using a SQL server SP. 3 10239
On 6 Jan 2004 14:24:14 -0800, la*************@hotmail.com (Lauren
Quantrell) wrote: Can anyone post any code that will count the number of elapsed days in a year? I want code that tells me 1/1/2004 is day 1, 2/1/2004 is day 32, etc. I plan to use this in a calendar that caculates people's birthdays from today's date using a SQL server SP.
Take a look at the DateDiff function. For example ...
?DateDiff("d",DateSerial(year(date()),1,1)-1,#2/1/04#)
32
?DateDiff("d",DateSerial(year(date()),1,1)-1,Date())
6
- Jim
?Format(#2/1/2004#, "y")
32
?Format(#2/29/2004#, "y")
60
?Format(#12/31/2004#, "y")
366
--
Doug Steele, Microsoft Access MVP http://I.Am/DougSteele
(No private e-mails, please)
"Lauren Quantrell" <la*************@hotmail.com> wrote in message
news:47**************************@posting.google.c om... Can anyone post any code that will count the number of elapsed days in a year? I want code that tells me 1/1/2004 is day 1, 2/1/2004 is day 32, etc. I plan to use this in a calendar that caculates people's birthdays from today's date using a SQL server SP. la*************@hotmail.com (Lauren Quantrell) wrote in
news:47**************************@posting.google.c om: Can anyone post any code that will count the number of elapsed days in a year? I want code that tells me 1/1/2004 is day 1, 2/1/2004 is day 32, etc. I plan to use this in a calendar that caculates people's birthdays from today's date using a SQL server SP.
HMMM ... Where will you use this "code" ... VBA ... or in the SPROC itself?
VBA: DatePart("y", Date)
T-SQL: DATEPART(y, DATE)
--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tux |
last post by:
How can I calculate number of days between two dates?
|
by: Shuffs |
last post by:
Could someone, anyone please tell me what I need to amend, to get this
function to take Sunday as the first day of the week?
I amended the Weekday parts to vbSunday (in my code, not the code...
|
by: jimfortune |
last post by:
I have an A97 module called modWorkdayFunctions in:
http://www.oakland.edu/~fortune/WorkdayFunctions.zip
It allows the counting of workdays taking into consideration up to 11
U.S. holidays. ...
|
by: Scott Kilbourn |
last post by:
Hi,
Does anyone know how to accurately calculate the number of days that have
elapsed since 01/01/0000? I'd appreciate any help anyone could give me.
Thanks
|
by: none |
last post by:
I have managed to get the below script *almost* working. However, it
still has a problem calculating the number of months. The date I am
trying to calculate from is Oct 15, 1994. With the correct...
|
by: Beemer Biker |
last post by:
I cant seem to get that date into any DateTime to make my calculation
directly by subtracting "01-01-0000" from "now".
After reading this:...
|
by: muld |
last post by:
I've inherited a database system designed to calculate sickness absence statistics. There is a main table with an employee ID which also holds the number of days worked by that person in a year ....
|
by: Gabriel Genellina |
last post by:
En Fri, 02 May 2008 16:13:41 -0300, Simon Pickles <sipickles@googlemail.comescribió:
Two options:
a) You can construct a datetime object with that info, using...
|
by: Tommy Jakobsen |
last post by:
Hi.
Is there a method in .NET that takes "year" as an argument and returns the total
number of weeks in that year? For culture da-DK (Danish).
Thanks in advance.
Tommy.
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |