# date manipulation in Toad automation tool

**URL:** <https://forums.toadworld.com/t/date-manipulation-in-toad-automation-tool/10715>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [September 26, 2011, 12:25pm UTC](https://forums.toadworld.com/t/date-manipulation-in-toad-automation-tool/10715 "2011-09-26T12:25:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GregDavis11009](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/gregdavis11009/32/122_2.png) [@GregDavis11009](https://forums.toadworld.com/u/GregDavis11009)\
**Post date:** [September 26, 2011, 12:25pm UTC](https://forums.toadworld.com/t/date-manipulation-in-toad-automation-tool/10715/1 "2011-09-26T12:25:35Z")

</div>

I am trying to set up a variable in the Toad automation tool to get the last Friday but I have not been able to figure out the DatePart function in setting a variable value. Also FormatDateTime only seems to have 4 formats available (no custom formats). My workaround is to call a SQL function and output the result to the automation variable. Is there a Toad function in the script automation tool that can do this?
