SysTime & SysDate functions

Discussions about editing and cleaning data
Marc-Olivier Z
Posts: 16
Joined: September 30th, 2016, 12:48 pm

SysTime & SysDate functions

Postby Marc-Olivier Z » July 1st, 2018, 7:48 am

Morning all users and administrators.

I'm working to design a new data entry and I want the date and time be generated by the system. So I used the functions sysdate() and systime().
But the matter is in the fact that time/date update each time I have to move on again time/date question. I would like it keeps the values which appear the first time I moved on those questions.
Please, how should I do that???

Thanks for your answers!!!

Gregory Martin
Posts: 1184
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: SysTime & SysDate functions

Postby Gregory Martin » July 1st, 2018, 12:31 pm

You can do something like this:

PROC FIRST_TIME

preproc

    if visualvalue(FIRST_TIME) = notappl then
        FIRST_TIME = systime();
    endif;

Marc-Olivier Z
Posts: 16
Joined: September 30th, 2016, 12:48 pm

Re: SysTime & SysDate functions

Postby Marc-Olivier Z » July 2nd, 2018, 5:47 am

Thanks very much Gregory
It works now as I wanted :D

arkagwa
Posts: 108
Joined: November 18th, 2014, 5:25 am

Re: SysTime & SysDate functions

Postby arkagwa » January 9th, 2019, 3:36 am

Dear Josh

I have similar case for the GPS. I want to keep the GPS i obtained in 30 minutes ago because enumerators move around. When they move around they do try to review the interviews may be they captured wrong (street name or village), on the other hand the GPS changes and also we lose the actual location of the study.

How to avoid this problem as the one proposed in system date above :)

josh
Posts: 1866
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: SysTime & SysDate functions

Postby josh » January 9th, 2019, 5:26 am

The approach for GPS would be exactly the same as for the date. Instead of FIRST_TIME use the variables you use to store latitude and longitude.

arkagwa
Posts: 108
Joined: November 18th, 2014, 5:25 am

Re: SysTime & SysDate functions

Postby arkagwa » January 15th, 2019, 10:24 am

Dear Josh, Thanks works very well

khadija
Posts: 1
Joined: April 22nd, 2019, 10:27 am

Re: SysTime & SysDate functions

Postby khadija » April 22nd, 2019, 10:50 am

Hi everyone !
I have the same problem. I tried this proposal but it doesn't work because I put the item "time" in alpha. This is because I want to use the function ($=edit("99:99",systime()).

Can you help me please ?

Gregory Martin
Posts: 1184
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: SysTime & SysDate functions

Postby Gregory Martin » April 23rd, 2019, 10:33 am

With alpha fields you don't have to use visualvalue because you always get the "visual value," so you can just write:

PROC FIELD

preproc

    if $ = "" then
        $ = edit("99:99",systime());
    endif;


Return to “Editing”