473,699 Members | 2,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with DateAdd Function

rob
Hello all,

I have a report that is always due 14 weekdays (Monday thru Friday) from the
day it is suspensed.

I would like to use the DateAdd function using the weekday interval (
DateInterval.We ekday), but I've tried it and it returns the same value as
(DateInterval.D ay).

Am I doing something wrong, or do I have the wrong expection for this
function?
BTW - I already worked out a solution (using Select-Case and weekday
function).

Feb 11 '06 #1
2 3008
rob,

Based on this remark from the documentation, I would say that you have the
wrong expectation for the function:

"To add days to DateValue, you can use DateInterval.Da y,
DateInterval.Da yOfYear, or DateInterval.We ekday. These are treated as
equivalent because DayOfYear and Weekday are not meaningful time intervals."

Kerry Moorman

"rob" wrote:
Hello all,

I have a report that is always due 14 weekdays (Monday thru Friday) from the
day it is suspensed.

I would like to use the DateAdd function using the weekday interval (
DateInterval.We ekday), but I've tried it and it returns the same value as
(DateInterval.D ay).

Am I doing something wrong, or do I have the wrong expection for this
function?
BTW - I already worked out a solution (using Select-Case and weekday
function).

Feb 11 '06 #2
rob
I have to ask the "obvious" question: then why have different functions if
date and weekday are equivelant?

"Kerry Moorman" <Ke**********@d iscussions.micr osoft.com> wrote in message
news:66******** *************** ***********@mic rosoft.com...
rob,

Based on this remark from the documentation, I would say that you have the
wrong expectation for the function:

"To add days to DateValue, you can use DateInterval.Da y,
DateInterval.Da yOfYear, or DateInterval.We ekday. These are treated as
equivalent because DayOfYear and Weekday are not meaningful time
intervals."

Kerry Moorman

"rob" wrote:
Hello all,

I have a report that is always due 14 weekdays (Monday thru Friday) from
the
day it is suspensed.

I would like to use the DateAdd function using the weekday interval (
DateInterval.We ekday), but I've tried it and it returns the same value as
(DateInterval.D ay).

Am I doing something wrong, or do I have the wrong expection for this
function?
BTW - I already worked out a solution (using Select-Case and weekday
function).

Feb 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
28820
by: Chad Richardson | last post by:
I've always been mistified why you can't use a column alias in the group by clause (i.e. you have to re-iterate the entire expression in the group by clause after having already done it once in the select statement). I'm mostly a SQL hobbiest, so it's possible that I am not doing this in the most efficient manner. Anyone care to comment on this with relation to the following example (is there a way to acheive this without re-stating the...
3
1634
by: NewmanBT | last post by:
As you can see from the code below, several textboxes will be dynamically created and each will be tied to an org. The ChangeComment function should allow for an update to the database whenever the value of the associated textbox changes. However, I'm having trouble associating the textbox to the org. strOrg is a global variable which changes throughout the runtime. How do I capture its value at each stage a textbox is created so that...
1
4982
by: PMBragg | last post by:
ORINGINAL Post >Thank you in advance. I'm trying to pull all inventory items from December >of the previous year back to 4 years for my accountant. I know this can be >done, but I'm drawing a blank. I've tried; > >DateDiff("y",-4,DateIn) and get errors > >Please any assistance would be greatly appreciated. >
5
2392
by: Alicia | last post by:
Yes, but will that skip a week and group by the date for me? I basically wanted something that would do a count of the dates, then group them by their week name.. BEFORE: Resource Date Total number of times that date Appeared (Count) 4/3/03 4 4/4/03 2 (note 4/4/03 showed up twice)
3
3725
by: Annette Massie | last post by:
I am trying to insert a record into a table via code and one of the values to add I would like as a dateadd calculation on a value from a query. My code looks like this: Set db = CurrentDb() ' if the table is in the same database Set rsAdd = db.OpenRecordset("tblClientTreatment") With rsAdd .AddNew !ClientID = Me.ClientID
4
10163
by: ey.markov | last post by:
Greetings, I have an A2K application where for a report the user enters a month-end date, and the system must gather transactions for that month. No problem, I thought, I'll just use the DateAdd function for the beginning of the date range, like this: Between DateAdd("m",-1,!!) And !!
1
18992
by: C.Davidson | last post by:
Does subject VB.net 2003 support DateAdd function? I have tried to implement the following without success. In my example I tried to simply add 30 months to 9/18/2003 and I get "New date: 12:00:00 AM", no date Example direct from VB Language Reference: Public Overloads Function DateAdd(ByVal Interval As DateInterval,_ ByVal Number As Double, ByVal DateValue As DateTime) As DateTime End Function
2
4554
by: Rich Raffenetti | last post by:
I have the following code. If I do the dateadd function with dateinterval.minute, it works fine and the date/time value is displayed with zero seconds. If I do the dateadd function with dateinterval.second, an error is thrown saying I have an overflow. I would be happy to know if I am doing something wrong or if I could do it differently to get the seconds to display properly. Const largeInteger As Long = &H1C5EA3B5F585F1F Const...
3
2147
by: mlcampeau | last post by:
Hi guys, I am trying to run a query that calculates when employees become eligible for supplemental vacation. This occcurs once the employee has reached 5, 10, 15, etc years of service. I got the query running great, it shows the correct dates, (5, 10, etc years after the HireDate) but I just found out that they don't want to know the exact anniversary date. People become entitled to their vacation January 1st of the year of their anniversary...
2
2434
by: Mangler | last post by:
I created a query in SQL that works fine but when i put it in the asp code ( with dreamweaver ) i am getting an error when viewing the page: expected end of statment... rsBERProd_cmd.CommandText = "SELECT ISNULL(sum(case when type = 'BD' and _dte = Convert(Char(8),GETDATE(),112) then qty else 0 end),0) as Dayqty,ISNULL(sum(case when type = 'BD' and _dte between dateadd(dd,- (day(GetDate())-1),GetDate()) and ...
0
8706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8630
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8899
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6550
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5889
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4638
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3075
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2364
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2016
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.