using the @Adjust command

Hi! experts
I have a view named amla with the ff: columns

date of report value is dcol
status value is stat
branch value is branch

I also have an action button to send the data or record to Head Office.  The action button have the formula below:

FIELD Flag := Flag;
FIELD by := by;
@If(@Today >= @Adjust(dcol; 0; 0; 13; 0; 0; 0);@Failure( "The check date must be between 3 days from date received and not dated one year from date received." ); Flag = "No" & by != "";
@Do(@Prompt([OK];"@mailsend dapat dito");
@SetField("Flag"; "Yes");@Prompt([OK];"AMLA";"CSV File Sent"));Flag = "Yes"; @Prompt([OK];"AMLA";"CSV File Already Sent");@Prompt([OK];"Error";"Double click the newly created document and enter Reported by field." ))

What I want is that before sending it will check the dcol field versus the date today, if it is more than 13 days ..it will not send the record and prompt the user that the data is more than 13 days ....need help thanks guys!
ememAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

madheeswarCommented:
Try this:

FIELD Flag := Flag;
FIELD by := by;
FIELD dcol:=dcol;
@If(@Today >= @Adjust(dcol; 0; 0; 13; 0; 0; 0);@Return(@Prompt([OK];"cannot send"; "The check date must be between 13 days from date received and not dated one year from date received." )); @If(Flag = "No" & by != "";
@Do(@Prompt([OK];"@mailsend dapat dito");
@SetField("Flag"; "Yes");@Prompt([OK];"AMLA";"CSV File Sent"));Flag = "Yes"; @Prompt([OK];"AMLA";"CSV File Already Sent");@Prompt([OK];"Error";"Double click the newly created document and enter Reported by field." )))
0
ememAuthor Commented:
ok ill try this ....ur such a big help and the other experts as well ...get back to you soon....
0
ememAuthor Commented:
madheeswar got this error "Incorrect data type for operatoror @ function: Time/Date expected"....dcol is in date format how come? if not in date format how can i convert text to date is there a way?
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

madheeswarCommented:
@TextToTime(dcol)

or use:
@textToTime(@text(dcol))

this may happen in @Adjust function and replace dcol with the above where ever necesary. Do it one after another.
0
ememAuthor Commented:
ok ill try this thanks again
0
ememAuthor Commented:
madheeswar.....i still encountered the error "Incorrect data type for operatoror @ function: Time/Date expected" how come?

FIELD Flag := Flag;
FIELD by := by;
FIELD dcol :=@texttotime(dcol);
@If(@Today >= @Adjust(dcol; 0; 0; 13; 0; 0; 0) & @Today >=@Adjust(dcol; 0; 0; 1; 0; 0; 0);@Return(@Prompt([OK];"Cannot send"; "Cannot Send CSV Files more than 10 days from Date of Report.  Manually Send your files to Compliance Office" )); "";@Today < @Adjust(dcol; 0; 0; 13; 0; 0; 0) & @Today >@Adjust(dcol; 0; 0; 1; 0; 0; 0);@Prompt([OK];"Sent"; "Sent CSV Files to late archive" ;
@If(Flag = "No" & by != "";
@Do(@Prompt([OK];"@mailsend dapat dito");
@SetField("Flag"; "Yes");@Prompt([OK];"AMLA";"CSV File Sent"));Flag = "Yes"; @Prompt([OK];"AMLA";"CSV File Already Sent");@Prompt([OK];"Error";"Double click the newly created document and enter Reported by field." ))))
0
ememAuthor Commented:
i have also notice that the first time it will work but the next time it will display the error msg ...
0
madheeswarCommented:
Thats why try step by step:
First create Button: test Date
in that :
FIELD dcol:=dcol;
res:=@Adjust(dcol;0;0;13;0;0;0);
@Prompt([OK];"Result";@text(res))

Like this debug the code line by line. U wil get the result. Try with different docs and different scenarios.

Hope it sheds some light.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.