Author Question: Describe the DateDiff, DateAdd, DateSerial, and DatePart functions, and give an example of each. ... (Read 31 times)

stevenposner

  • Hero Member
  • *****
  • Posts: 608
Describe the DateDiff, DateAdd, DateSerial, and DatePart functions, and give an example of each.
 
  What will be an ideal response?

Question 2

Lists are a series of paragraphs.
 
  Indicate whether the statement is true or false



tmlewis4706

  • Sr. Member
  • ****
  • Posts: 295
Answer to Question 1

The DateDiff function is used to determine the difference between two dates. Generally one date is obtained from a field, and the second date is obtained by using the Date function. Many instances exist in which you could use the DateDiff function. For example, suppose you have a form that you use to automatically refill customer prescriptions. In the Orders table, you have a field named Refill On that contains the earliest date that the prescription can be refilled. You can use the DateDiff function with a text box on the form to display the number of days left before the prescription can be refilled and shipped.
You can use the DateAdd function to add or subtract a specific time interval from a date. For example, you can use DateAdd to calculate a date 10 days from today or a time 30 minutes from now. Business professionals work with dates on a regular basis. A human resources manager may want to calculate when a newly hired employee is eligible for benefits, which is generally 90 days after the date of hire. Additionally, the human resources manager may want to calculate the earliest date an employee can retire.
To display specific dates, you can use the DateSerial function to manipulate the day, month, and year of a date. DateSerial is very flexible because you can manipulate each part individually or together in any combination that meets your needs. For example, when the human resources manager wants to prepare paperwork for an employee's retirement, the manager can use the DateSerial function to calculate 90 days prior to the employee's 65th birthday. Naturally, you would take the birthdate and add 65 years. Then take that date and subtract 3 months. Using the DateSerial function, you can do this in one step.
You can use the DatePart function to examine a date and return a specific interval of time. For example, you can use DatePart to calculate the day of the week for an order's ship date.

Answer to Question 2

TRUE



Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
 

Did you know?

A seasonal flu vaccine is the best way to reduce the chances you will get seasonal influenza and spread it to others.

Did you know?

Once thought to have neurofibromatosis, Joseph Merrick (also known as "the elephant man") is now, in retrospect, thought by clinical experts to have had Proteus syndrome. This endocrine disease causes continued and abnormal growth of the bones, muscles, skin, and so on and can become completely debilitating with severe deformities occurring anywhere on the body.

Did you know?

People who have myopia, or nearsightedness, are not able to see objects at a distance but only up close. It occurs when the cornea is either curved too steeply, the eye is too long, or both. This condition is progressive and worsens with time. More than 100 million people in the United States are nearsighted, but only 20% of those are born with the condition. Diet, eye exercise, drug therapy, and corrective lenses can all help manage nearsightedness.

Did you know?

Illness; diuretics; laxative abuse; hot weather; exercise; sweating; caffeine; alcoholic beverages; starvation diets; inadequate carbohydrate consumption; and diets high in protein, salt, or fiber can cause people to become dehydrated.

Did you know?

Methicillin-resistant Staphylococcus aureus or MRSA was discovered in 1961 in the United Kingdom. It if often referred to as a superbug. MRSA infections cause more deaths in the United States every year than AIDS.

Methicilli ...

For a complete list of videos, visit our video library