Snoozing at the OASIS
Posted on 28 Jan 2009 at 17:07
This month, Simon Jones looks into the maintenance of the ODF standard, and sizes up the new Outlook add-in Xobni.
The DateDiff() function in Visual Basic and SQL Server takes different parameters in a different order and can calculate weeks, quarters, hours, minutes and seconds as well as days, months and years between the two dates. You can call this from a cell in an Excel workbook if you wrap it up into your own public macro function.
For instance, if you put this code into a new Module in your workbook:
Public Function DateDifference(Interval As String, Date1 As Date, Date2 As Date)
DateDifference = DateDiff(Interval, Date1, Date2, vbMonday, vbFirstJan1)
End Function
then you can use this customised DateDifference() function to pass the relevant parameters on to VBA's DateDiff() function and return the result to a cell, for example = DateDifference("q", D1, D2).
The two optional parameters in DateDiff() state what the first day of the week is and when the first week of the year starts. These can be set explicitly, or else set to follow the Control Panel settings for the current computer. Beware that different Control Panel settings may then change the result of the DateDiff() function, and you might get different results on different PCs - if you need consistent results, fix these parameters to known values. Also, depending on these settings and the dates concerned, DateDif() and DateDiff() can yield different numbers of months between dates.
From around the web
lookeen for the best search
I use lookeen! unbelievable fast, very accurate, great handling and lots of filters and functions. just to mention some features: as lookeen being an outlook add-in, you can search very comfortable your mails plus attachments in multiple (!) PST-files. lookeen is compatible withe microsoft exchange servers and offers the use of an shared index (to spare system resources)...no other prog offers so many features.
www.lookeen.net
By JudginD on 26 Nov 2009 ![]()
advertisement
- Why virtualisation hasn't slowed the growth of data
- How to make Google AdWords work for your business
- The curse of sloppily written software
- Paying for your crimes with Bitcoin
- Behind the scenes: tech support for Formula 1
- The security risk of fat fingers
- Why Windows Phone 7 isn't quite ready for business
- When will Microsoft stop fiddling with Windows 8?
- Flash down the pan?
- Metro Style apps vs desktop applications
- Chrome's shine getting lost in translation
- BytePac: the cardboard hard disk enclosure
- How tech loosens our grip on reality
- Hokum watch: Safer Internet Day
- Why I'm deleting Adobe from my PC
- Prepare to be patronised: it's Safer Internet Day
- Dear Sony, Samsung and every other tech company in the world: stop trying to be Apple
- Will Apple's Final Cut Pro X update placate the pros?
- Smartr Contacts for iPhone review
- Switching to Office 365's Outlook Web App
- VeriSign slammed for security breach cover-up
- SAP willing to share HANA with Oracle
- Why using a tablet could harm your health
- New RIM boss: no need for drastic change
- RIM founders fall on their swords
- Slow economy helps boost Red Hat revenue by 23%
- Google+ pages get multiple admins
- One in five companies lack card industry compliance
- Oil industry warns hacking attacks could kill
- British workers fear email monitoring
advertisement

