CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Date

Print topic Send  topic

Author Message
Oper


Posts: 1195
Posted: 01/13/2004, 6:10 PM

I'm recording in a Field the date using now()
so the filed contain Date + time

whne i using a report a use the normal date filter
when i choose Date from and date to the Date 2 dont shwoup on the grid. its obvious cause the date in the file have the time
onit and the ndate from the searcher is just a Date.

how could i solve this using Date from to.

for example: from 12/01/2004 to 13/01/2004
will display only the date 12/01/2004

cause the other record are like 13/01/2004 12:05:23

:) first real problem i cant solve since i started using CCS (and i strated from th eBeta) :)



_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
peterr


Posts: 5971
Posted: 01/14/2004, 1:48 AM

I'm not sure if you're using the Table or SQL statement, but you should be able to specify somewhere to search for the ending date smaller than date_parameter +1.
I haven't done this myself, but now tried quickly in MS Access and such WHERE statement worked.
(WHERE order_date > [Start Date] AND order_date < [End Date]+1)

Since the entered date starts at midnight, adding one day will allow you to look only for records with a time before midnight the next day.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Oper_g
Posted: 01/14/2004, 2:54 PM

i was trying to do that but how i incorporate
this: [s_order_date < End Date]+1 on the Grid Table Selection?

thank for the answer peterr in advanced
Edd


Posts: 547
Posted: 01/14/2004, 6:59 PM

Oper_g,
I don't know what database you are using but I always convert my dates to strings and truncate the times. I have been screwed up dozen's of times where machines have been set back to US date formats (I am an Aussie) and you get caught some times when operators upgrade Web and SQL servers and don't set the local dates.

In MSSQL I use the convert function - change your select to SQL.

Where convert(Char(10, order_date, 120) = '{s_order_date}'

make sure your s_order_date is format 'YYYY-MM-DD' and it will work.


_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message
BlinkyBill

Posts: 86
Posted: 01/15/2004, 1:07 AM

Quote Edd:
Oper_g,

In MSSQL I use the convert function - change your select to SQL.

Where convert(Char(10, order_date, 120) = '{s_order_date}'


Edd,

The convert function is redundant in the above example, with SQL Server just use ISO format for all dates, ie
WHERE order_date = '20040115' 
the server will do the implicit conversion for you, ISO is YYYYMMDD. Plus this looks neater.
View profile  Send private message
peterr


Posts: 5971
Posted: 01/15/2004, 1:08 PM

Oper,

The above suggestions should be helpful if you change your Table-based Data Source to an SQL statement. In such case you may also try this Where statement:
WHERE order_date < #{s_date}# +1
Since you're using Grid Table Selection, here is sample code for "Before Build Select" event:
dim s_date  
s_date = CCGetRequestParam("s_date", ccsGET)  
if s_date<>"" then orders.DataSource.Where = "order_date < #" & CCGetRequestParam("s_date", ccsGET) & "# +1"
(I run a quick test with MS Access)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 01/15/2004, 1:11 PM

Oops, the "Before Build Select" event code should be:
dim s_date  
s_date = CCGetRequestParam("s_date", ccsGET)  
if s_date<>"" then orders.DataSource.Where = "order_date < #" & s_date & "# +1"

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.