ckroon
Posts: 869
|
| Posted: 07/06/2006, 5:58 PM |
|
I have a grid displaying records of "events". Each event has an event_date. I want it to only display those recrods that are =or greater than the current date.
I have tried countless methods to get this to work, to no avail.
Anyone care to point me in thei right direction?
I figure that editing the Where statement of the Data Source to say: Where event_date (>=) CurrentDate would work..?
_________________
Walter Kempees...you are dearly missed. |
 |
 |
marcwolf
Posts: 361
|
| Posted: 07/06/2006, 6:52 PM |
|
Hi there
It depends on which language you are using.
I use ASP and so there is the NOW() function to return the current date.
Also re the database you are using it also depends on the format of the stored date there.
i.e. local system format is dd/mm/yyyy but DB date is yyyy-mm-dd
You will need to use the ccFormatDate function to get the best format of the date you nees.
then you can add in the WHERE
"eventdate >= '" & ccformatdate(now(),Array('yyyy','-','mm','-','dd')) & "'"
Hope this give you some pointers
Take Care
Dave
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
|
 |
 |
ckrooner
|
| Posted: 07/06/2006, 7:07 PM |
|
PHP is the language
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 07/06/2006, 11:53 PM |
|
Also depending on your database you can use database date functions. Here are such functions and sample queries for MySQL: http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
In CCS VQB you would change "Condition Type" to "Expression" and then type the relevant part of the WHERE statement, like Expression= "event_date >= your_database_function_for_current_date"
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
jerry
|
| Posted: 08/05/2006, 10:04 PM |
|
i'm new to CCS and am having trouble to generate a report that gets the user
to input a start date and end date. could anybody help.
"ckroon" <ckroon@forum.codecharge> wrote in message
news:244adb1d16f4d9@news.codecharge.com...
>I have a grid displaying records of "events". Each event has an event_date.
>I
> want it to only display those recrods that are =or greater than the
> current
> date.
> I have tried countless methods to get this to work, to no avail.
> Anyone care to point me in thei right direction?
>
> I figure that editing the Where statement of the Data Source to say: Where
> event_date (>=) CurrentDate would work..?
>
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|