Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Date Add Field Post Reply Post New Topic
Author Message
ridershaun
Newbie
Newbie


Joined: 31 Aug 2010
Online Status: Offline
Posts: 32
Quote ridershaun Replybullet Topic: Date Add Field
    Posted: 26 Jul 2017 at 11:06am
Could someone please tell me what this command is doing?

>DateAdd("yyyy",-1,Date())

I thought I had it figured out, but I am seeing weird days in the results when executing. This is a report that I have taken over and it seems odd to me that we are using this command. Any help would be appreciated.

Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jul 2017 at 11:33am
I am assuming this is part of some other code like a where clause?
it is saying
"greater than 1 year ago from this second"
So it is likely comparing a date to see if it is > 1 year ago right now.
Note that SQL GETDATE() uses current date and time so using it in a > or >= sometimes misses the "current calendar day-1 year" because the midnight portion

Edited by DBlank - 26 Jul 2017 at 11:34am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.