11/03/2011 01:22 by JohnEverard
Click the Windows "Start" button and select "All Programs." Click "Microsoft Office," then click "Microsoft Excel" to start the program.
Press the "Ctrl" and "O" keys on the computer. In the opened dialog window, double-click the file you want to edit. Click the cell where you want the results of the "DateDiff" function to appear.
Click the "Developer" ribbon tab at the top of the Excel window. Click the "Visual Basic" button to open the VBA editor. Double-click "Sheet1" to open the editor to the current sheet.
Type the following code in the editor:
Function GetDifference (myDate1 as Date, myDate2 as Date) as Long
GetDifference = DateDiff("d", myDate1, myDate2)
End Function
Click the "Save" button, then close the VBA editor. Type "=GetDifference(A2, A1)" and press "Enter." Replace "A2" and "A1" with the cells that contain the dates you want to compare. Excel calls the VBA function and displays the date difference in days.
A:Function Explanation Understand the DateDiff function. The DateDiff function uses the expression "=DateDiff (interval, date1, date2)" to cal...(more)
A: Determine the start date and end date. To calculate a person's current age, use the birthday as the start date and the current date for the ...(more)
A: Set up the query statement. Using the "?" signifies to the SQL Server that a parameter is used. The following statement queries the database...(more)
A: Click the "Start" button. Navigate to the "Microsoft SQL Server" folder appropriate to the installed version, and then click on "SQL Server ...(more)
A: Click the Windows "Start" button. Click "All Programs," then click "SQL Server Express" and then click "SQL Server Management Studio." This ...(more)
Added Successfully!
×Voted Successfully!
×You can't vote for yourself
×You can't choose your own answer
×