NathanFriend.co.uk

Developers notebook

Month: June 2016

Duplicate a directory structure.

From the root of structure you want to duplicate run find . -maxdepth 2 -type d | sed 's/$/"/' | sed 's/^/mkdir "/' > create.sh

-maxdepth sets the recursion level.
-type d identifies only directories.
sed commands wrap the output in mkdir “{Path}”

Output is redirected to a file.

MS Access Sum a date time field

Example data

id TimeElapsed User
1 00:01:44 Bob
2 00:01:46 Bob

To sum a date time field first convert the field data to double with an expression using the CDbl Function.

exp1: CDbl([TimeElapsed])

Set the total type to Sum.

Then create another expression to convert the data from the first expression back to a date time field using the CVDate function.

exp2: CVDate([exp1])

Set the total value to Expression.

TimeElapsed User
00:03:30 Bob

© 2017 NathanFriend.co.uk

Theme by Anders NorenUp ↑