473,471 Members | 1,850 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to set Default Date Form Value to run from Fri to Sun, when ran on a Mon?

1 New Member
I need to set a default date on a form that when it comes to a Monday, the form from and to dates will default to the Friday to Sunday of the previous week. For all other day, the form should default to the previous day.

Can anyone help?
Thanks in advance
Feb 24 '06 #1
1 1983
CaptainD
135 New Member
First, need to know what language or program you're using.

Basically, use a DayOfWeek(YourDate) (Depends on the program or language)to find out what day your at and then use a DateAdd(YourDate, -HowManyDays) to get the date you want.

I need to set a default date on a form that when it comes to a Monday, the form from and to dates will default to the Friday to Sunday of the previous week. For all other day, the form should default to the previous day.

Can anyone help?
Thanks in advance
Mar 29 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Ragnar Heil | last post by:
I have got a form where I offer a default date (01.01.2004) and visitors can change it and make queries in the database. After changing this, the customized date should be displayed in the form...
11
by: David Messner | last post by:
Ok I know this is simple but the statement eludes me... I have a date field where I want the default value on the data entry form's date field to be the last date entered. I figure I can do this...
1
by: Delatere | last post by:
Hello, can anabody help? in the following part i cannot pass de desired default value In the module of the mbd i declared: Global datum_Glo As String in a form (Dossier_FRM)i did
4
by: helenwheelss | last post by:
Access 2003, using a bound form. I'm seeing rather annoying behaviour when editing data in a control with a default value. It only happens when the form is on a new record. A specific...
4
by: JHite | last post by:
I am using Access 2003 on Windows XP. This is a simple database that contains “tblStaffers” containing names of the office staffers, “tblProjects” containing names of the office projects, and...
0
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,...
0
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...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
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,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.