Hi everone,
I want to add a criteria to filter out the Sales Order date.
For example, today is 10 Oct 2005, the default range that I want for the
user like this:
Start Order Date: 10 Sep 2005
End Order Date: 10 Oct 2005
I don't know how to set in parameter for the user! Can I use the following
function (like VB)?
=dateadd('m', -1, Globals!ExecutionTime) ==> for Start Order Date
Please help!
TonyDear all,
I can fix the problem, the correct one should be:
=dateadd("m", -1, Globals!ExecutionTime)
For your reference!!!!!
Tony
"Tony" wrote:
> Hi everone,
> I want to add a criteria to filter out the Sales Order date.
> For example, today is 10 Oct 2005, the default range that I want for the
> user like this:
> Start Order Date: 10 Sep 2005
> End Order Date: 10 Oct 2005
> I don't know how to set in parameter for the user! Can I use the following
> function (like VB)?
> =dateadd('m', -1, Globals!ExecutionTime) ==> for Start Order Date
> Please help!
> Tony
Showing posts with label criteria. Show all posts
Showing posts with label criteria. Show all posts
Sunday, March 11, 2012
Friday, February 24, 2012
date criteria
Im looking for a SELECT statement to pull all records from a table where the difference between two dates (columns in the table) are greater than a certain number (5 in this case.)
So lets say theres a table called Projects, and in this table is ProjectStart and ProjectComplete. I would need all the records where the ProjectComplete is more than 5 days past ProjectStart.
(So for example a ProjectStart of 9/8/03 and a ProjectEnd of 9/10/03 wouldnt show up, but a ProjectStart of 8/5/03 and a ProjectEnd of 9/22/03 would.)
Thanks!SELECT * FROM Projects
WHERE DateDiff(dd, ProjectStart, ProjectComplete) > 5
So lets say theres a table called Projects, and in this table is ProjectStart and ProjectComplete. I would need all the records where the ProjectComplete is more than 5 days past ProjectStart.
(So for example a ProjectStart of 9/8/03 and a ProjectEnd of 9/10/03 wouldnt show up, but a ProjectStart of 8/5/03 and a ProjectEnd of 9/22/03 would.)
Thanks!SELECT * FROM Projects
WHERE DateDiff(dd, ProjectStart, ProjectComplete) > 5
Friday, February 17, 2012
Date calculation
Im relatively new with sql and im having a problem
creating a criteria based on todays date less 150 days.
I tried to use the following...
< GetDate () -150 however it will not let me use this.
I know that there must be away to do this, but I need
help.. Thank you in advance
On Tue, 3 Aug 2004 10:37:13 -0700, Bob wrote:
>Im relatively new with sql and im having a problem
>creating a criteria based on todays date less 150 days.
>I tried to use the following...
> < GetDate () -150 however it will not let me use this.
>I know that there must be away to do this, but I need
>help.. Thank you in advance
Hi Bob,
Try it with DATEADD(day, -150, getdate()).
If you remove the space between getdate and (), your code would work as
well, but I recommend using DATEADD anyway - just subtracting 150 relies
on the internal storage of datetime values; this is not guaranteed to
remain unchanged between SQL Server versions.
Also remember that getdate() gives current date *AND* time. Not a problem
for "smaller than" comparissons, but if you ever have to match on "equal"
date, you'll have to use some extra tricks to get rid of the time portion.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
creating a criteria based on todays date less 150 days.
I tried to use the following...
< GetDate () -150 however it will not let me use this.
I know that there must be away to do this, but I need
help.. Thank you in advance
On Tue, 3 Aug 2004 10:37:13 -0700, Bob wrote:
>Im relatively new with sql and im having a problem
>creating a criteria based on todays date less 150 days.
>I tried to use the following...
> < GetDate () -150 however it will not let me use this.
>I know that there must be away to do this, but I need
>help.. Thank you in advance
Hi Bob,
Try it with DATEADD(day, -150, getdate()).
If you remove the space between getdate and (), your code would work as
well, but I recommend using DATEADD anyway - just subtracting 150 relies
on the internal storage of datetime values; this is not guaranteed to
remain unchanged between SQL Server versions.
Also remember that getdate() gives current date *AND* time. Not a problem
for "smaller than" comparissons, but if you ever have to match on "equal"
date, you'll have to use some extra tricks to get rid of the time portion.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
Labels:
based,
calculation,
criteria,
database,
date,
following,
getdate,
microsoft,
mysql,
oracle,
problemcreating,
relatively,
server,
sql,
todays
Subscribe to:
Posts (Atom)