This topic is locked
[SOLVED]

 Display Only The Last 6 Months on report

1/7/2014 11:41:16 AM
ASPRunnerPro General questions
G
gonzalosb author

Hi All,

i create a report page with fields "CompanyName" and "DeliveryDate" and shows the date that delivery was made for that client.

example:
Gold Communications

12/20/2013

1/2/2014

1/4/2014

etc, etc
now, i nedd to limit the date display to the last 6 months, no more than that.
thank you in advance.

K
kleanthis 1/7/2014



Hi All,

i create a report page with fields "CompanyName" and "DeliveryDate" and shows the date that delivery was made for that client.

example:
Gold Communications

12/20/2013

1/2/2014

1/4/2014

etc, etc
now, i nedd to limit the date display to the last 6 months, no more than that.
thank you in advance.


Try in the query window in the SQL tab the following code

select * from tablename where dtstamp>getdate()-180
G
gonzalosb author 1/8/2014

it doesn't work for me, give me an error.

Sergey Kornilov admin 1/8/2014

gonzalosb,
you need show us exact query and exact error message. We also need what database do you use.
More info you give is better.

K
kleanthis 1/9/2014



gonzalosb,
you need show us exact query and exact error message. We also need what database do you use.
More info you give is better.


Try this...



WHERE (DatePart("m", DateField) = DatePart("m", DateAdd("m",0, getdate()-180)))
G
gonzalosb author 1/10/2014

i'm using MS database


Sergey Kornilov admin 1/10/2014

Check your "MS" database documentation in regards to what date functions you can use. Date functions are different for each database.
You cannot also use to "selects" in single SQL query. Reset your query and only modify the WHERE clause, do not add yet another "select" there.

G
gonzalosb author 1/15/2014

ok, done!!!

thanks to you 2 (kleanthis and Sergey) i get the solution.

WHERE DeliveryDate>Date()-180


Easy sloution for MSAccess Database

lefty 1/16/2014



ok, done!!!

thanks to you 2 (kleanthis and Sergey) i get the solution.

WHERE DeliveryDate>Date()-180


Easy sloution for MSAccess Database


Try This DeliveryDate >= (Date()- 180)

*** to get today**