PDA

View Full Version : sysdate4 is flagged as a 19.1 warning, sysdate isn't



DaveR
17-Sep-2018, 03:52 PM
Omission or decision?

Garret Mott
17-Sep-2018, 04:12 PM
Wasn't Sysdate4 deprecated a while ago? Sysdate now does 4 year dates - as of 14.1 or some such I think.

DaveR
18-Sep-2018, 03:40 PM
Wasn't Sysdate4 deprecated a while ago? Sysdate now does 4 year dates - as of 14.1 or some such I think.

Sure, but not really what I'm asking.

19.1 warnings suggest Move (CurrentDateTine()) to ddatefield for sysdate4, but not for sysdate.

Garret Mott
18-Sep-2018, 07:04 PM
According to Dennis, CurrentDateTime() is for datetime only - not dates. A while back I ran into issues (1767 dates!) with code that had Move (CurrentDateTime()) to dDate & removed every one from the app.

Samuel Pizarro
18-Sep-2018, 07:46 PM
Now I get curious.

What errors are that?

since currentdatetime() funciton was added I only use them.
Never used the syadate cmds anymore since those date/datetime functions were added.

Can you remember and elaborate a little bit on what kind of issues you had?

Bob Worsley
18-Sep-2018, 08:26 PM
According to Dennis, CurrentDateTime() is for datetime only - not dates.Is it DAW's contention that (date(CurrentDateTime())) shouldn't be used?

Clive Richmond
19-Sep-2018, 04:26 AM
Hi Dave,


Omission or decision?

These earlier posts may have some bearing on the subject matter.

Set_Date_Attribute Warning (https://support.dataaccess.com/Forums/showthread.php?62995-Set_Date_Attribute-Warning)
Date Attributes and VDFBase.pkg (https://support.dataaccess.com/Forums/showthread.php?63009-Date-Attributes-and-VDFBase-pkg)

Garret Mott
19-Sep-2018, 06:17 AM
Here's the thread from when I had the problem: https://support.dataaccess.com/Forums/showthread.php?62537-DateTime-Questions&highlight=date+datetime

"Move (CurrentDateTime()) to dDate" was intermittently filling dDate with bogus dates. As mentioned - a year of 1767 (I'm old, but not that old! ;)) and also month values > 12. I converted every instance to Sysdate or "Move (CurrentDateTime()) to dDateTime" and then moved the DateTime variable to a Date - either variable or field. Since doing that no errors on bad dates.

Garret Mott
19-Sep-2018, 06:19 AM
Dunno. That's my intelligent answer for the day...

Samuel Pizarro
19-Sep-2018, 06:25 AM
Wow.

I need to review my code. That’s bad.

But I believe in most of places when I need only the date portion I normally use


Move (date(currentdatetime())) to dDateVar


I guess that would be fine ?

Thanks Garret

Focus
19-Sep-2018, 06:42 AM
I blame that Julian geezer

Garret Mott
19-Sep-2018, 06:56 AM
I have not used that - but it seems that Bob does also. Having started in the dark ages, I like Sysdate dDateVar. Less typing...

DaveR
19-Sep-2018, 09:03 PM
Is it DAW's contention that (date(CurrentDateTime())) shouldn't be used?

wait? Wut? Whaaat?

never even tried that. Does it work?

Is it better than (date(now))?

Just finally seen datepart too...

I've a lot of trawling through hundreds of sources to do to finally kill off my old kdates.pkg

Mark Powers
20-Sep-2018, 11:20 AM
This is also what I've been trying to use as well. That is (date(CurrentDateTime())
Mark

Garret Mott
20-Sep-2018, 11:30 AM
Why not just use Sysdate? Because it requires a variable?

Mark Powers
20-Sep-2018, 02:25 PM
I started doing it for the variable reason Garrett. When setting update a date field using a DD I use this: Set Field_Changed_Value of oSome_DD Field Some.ChangeDate to (Date(CurrentDateTime())). Prior to doing it this way you had to declare a variable, sydate the variable, and then put the variable in the DD field. Just seemed much easier and very readable.
Mark

Garret Mott
20-Sep-2018, 03:49 PM
Makes sense.

Bob Worsley
20-Sep-2018, 08:59 PM
It's not a function and yes, requires a variable. At least that's my reason and I'm sticking to it...

Vincent Oorsprong
20-Sep-2018, 11:41 PM
Samuel,

While OK the CAST() and CONVERT() are more mainstream solutions.

The number of data-types that can be used is more complex/extended over time.

Samuel Pizarro
21-Sep-2018, 07:57 AM
thks

Dennis Piccioni
21-Sep-2018, 10:29 AM
Hi Dave,

sysdate is not obsolete (sysdate4 still is), it will no longer be listed as such in the next (post Alpha 5) build.

DaveR
21-Sep-2018, 01:04 PM
Does (Date(now)) work? I'd never seen it before stumbling over it in the help. Even fewer keystrokes Garrett! :cool:

Dennis Piccioni
21-Sep-2018, 01:27 PM
Where in the help is this Dave?

DaveR
21-Sep-2018, 06:09 PM
Where in the help is this Dave?

Damned if I can find Now in the Alpha 5 help.

Look at 'Time, Date and Interval functions' in Alpha4 help, but I can't see where I saw the actual reference to move (Date(now)) to dVariable or whatever. Must be the meds, or I'm pining for a pint. Can't find DatePart today either...

Todd Forsberg
21-Sep-2018, 06:48 PM
DatePart and DateDiff are SQL functions, not DataFlex.

Bob Worsley
21-Sep-2018, 07:14 PM
are you sure you aren't thinking of .Net? Now is a .Net function, datetime.now = current datetime

DaveR
22-Sep-2018, 08:02 AM
are you sure you aren't thinking of .Net? Now is a .Net function, datetime.now = current datetime

AS I said to Dennis, Now() is in the Alpha4 help 'Time, Date and Interval functions' however that seems to have been rewritten or at least reformatted for alpha5 and it's gone.

Samuel Pizarro
22-Sep-2018, 05:16 PM
Now is a vb function

you might have saw it in DF reports help. Not in DF

DaveR
22-Sep-2018, 07:10 PM
Now is a vb function

you might have saw it in DF reports help. Not in DF

ah. I haven’t alpha4 at home now so can’t check. The fomatting of the time and date help where I saw it was slightly different so maybe.