All date has a numerical value .... e.g. 15-Dec has a value 44910 .......... So find the number (from Excel) of the FROM and TO Date........ Then Use the Function ---- $$RandomNumber:44896:44926 ... Both are numerical values for 01-Dec and 31-Dec.......... Then convert this back to DATE format.
type this function in a1 =RANDBETWEEN(DATE(2022,12,1),DATE(2022,12,31)) use above function in excel and type =TEXT(a1,"DD/MMM/YYYY") now you may double click on =RANDBETWEEN(DATE(2022,12,1),DATE(2022,12,31)) this will change date within given range
Try...this way ...... $$Date:"01-01-1901" which has a value of 1 ...... add the random number to this and deduct 1.
Thanks Amit ji it worked I used ($$Date:##AutoSaleEntryPostVar1)+ $$RandomNumber:1:30 where ##AutoSaleEntryPostVar1 store as Month start date But one more problem I want to get this date filtered that is $$DayOfWeek:$Date = "Monday" or $$DayOfWeek:$Date = "Tuesday" is it possible ?
Another Way I tried [Collection:SaleDateColl] Type:Voucher Title:"List Of Dates" Fetchate Format:$Date,20 Table Sort:$Date Filters:SaleDateflt1,SaleDateflt2 [System:Formula] SaleDateflt1$Date >= ##AutoSaleEntryPostVar1) And ($Date <= ##AutoSaleEntryPostVar4) SaleDateflt2: $$DayOfWeek:$Date = "Monday" or $$DayOfWeek:$Date = "Tuesday" from above collection I get the required date but how to use this collection dates in a fields randomly like for December month I get six date 5-12,6-12,12-12,13-12,19-12,20-12 but how to use this date Randomly from collection
[#Menu:Gateway of Tally] ;;Title:$$Randomnumber:$$date:$$20221201:20221231 Title:$$Randomnumber:20220501:20220531 this will work well for one month
Sir another one method for random number get no of days in two date & use Randome function for 0 to differtioal day and get result add in to starating days following code get reuslt call function like $$GetRandomDate:$StartDate:$EndDate (code not tested) Code: [Function:GetRandomDate] Variable:StartP1:Date Variable:EndP2:Date Variable:DifferenceDays:Number Variable:result:Date Return:Date 100:Set:DifferenceDays:$$Number:(##EndP2-##StartP1) 110:Set:DifferenceDays:$$RandomNumber:1:##DifferenceDays 120:Set:result:$$date:(##StartP1+##DifferenceDays) 130:Return:result
I tested your Function By some Minor Changes I get RandomDate Code: [Function:GetRandomDate] Parameter:StartP1 :Date Parameter:EndP2 :Date Variable:DifferenceDays :Number Variable:result :Date Return :Date 100:Set:DifferenceDays:$$Number:(##EndP2-##StartP1) 110:Set:DifferenceDays:$$RandomNumber:0:##DifferenceDays 120:Set:result:$$Date:(##StartP1+##DifferenceDays) ;122:Set:GetRandomDate:##result 130:Return:##result But Problem is 1)I want to use Random date in a repeated field (which will store different date value) under company object 2) I want to get those random date which is "Monday" or "Tuesday"
i dont undrestand 1 query 2 use while loop for random result for getting $$weekofday:##result = "Monday" or "Tuesday"
with help of function like Code: [Function:SetAggtValue] 50:Walk Collection:YourColl 100:Insert Collection Object:AggUdf Name 110:Set Value:YourDateUdf:$$GetRandomDate:$StartDate:$EndDate 120:Set Target:.. 130: End Walk
Wow Mr. Murtyms its awesome .I have little bit weakness in function. this is exactly what I want Thank you very much You really help me to get more knowledge about function Thanks again
Thank you .Sattamji I know your coding skills. In fact i am profited by your tdls. And I have great respect for you. However receiving an appreciation from an appreciated person gives immense happiness. Thank you once again.