script for extracting transactions on a particular day

3 posts / 0 new
Last post
padmathiagarajan
Offline
Joined: 07/02/2016 - 06:26
script for extracting transactions on a particular day

Hi Brian,
I am trying to do a script to extract all transactions on saturdays and sundays. 
When i go to field statistics i am able to see this and extract as well. But it doesnt get generated as a script. Also i am not able to find any idea function which can workaround.
How to go about?
 
Regards
Padma

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Padma,

The field statistics don't create any code around what ever the stat is. 

To obtain a transactoin on a Saturday or Sunday there is a function call @Workday() that you can use.  If it is equal to 0 it is on the weekend and if it returns a 1 it is during the week.

Here is what the code would look like:


Set db = Client.OpenDatabase("Sample-Bank Transactions.IMD")
Set task = db.Extraction
task.IncludeAllFields
dbName = "Weekend.IMD"
task.AddExtraction dbName, "", "@Workday(DATE) == 0"
task.CreateVirtualDatabase = False
task.PerformTask 1, db.Count
Set task = Nothing
Set db = Nothing
Client.OpenDatabase (dbName)

 Hopefully this is enough to get you going.

Thanks

Brian

padmathiagarajan
Offline
Joined: 07/02/2016 - 06:26

Thanks a ton!!