CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Portal Questions

Print topic Send  topic

Author Message
JCF
Posted: 09/04/2002, 2:15 PM

Hi All

CCS, PHP, MySQL - I have some questions - I have take the Portal and
modified it for my use, the Data structure is only changed a little. I have
added some fields, such as description and date, etc.

1. How do I have the Events on the opening page filtered by the Current
Date - For example I would like to list only the Events for the next 7
days? - I have looked and I don't see how create a varable and then put this
into the Select command?

2. With MySQL the dates are YYYY-mm-dd hh:mm:ss but in all the menu choices
through out CCS, It has the normal MS date choices (Long, short, etc.) but
not the MySQL - How do I set a date for Enter or Display?

Thanks for any help.

JCF

DonB
Posted: 09/04/2002, 4:01 PM

No mySQL expertise here, but can you write a query/view/whatever in mySQL
that inherently selects only today's rows? I mostly use SQL Server and do
that sort of thing (there is a function "getdate()" that always returns
today's date, so I SELECT where getdate()'s "day" component is equal to the
"day" from my records).

For things like this it's nice to embed the "logic" of the WHERE clause on
the server. This way, you don't have to code anything in CCS at all.

don


"JCF" <jcf@mail.org> wrote in message
news:al5t5r$u7b$1@news.codecharge.com...
> Hi All
>
> CCS, PHP, MySQL - I have some questions - I have take the Portal and
> modified it for my use, the Data structure is only changed a little. I
have
> added some fields, such as description and date, etc.
>
> 1. How do I have the Events on the opening page filtered by the Current
> Date - For example I would like to list only the Events for the next 7
> days? - I have looked and I don't see how create a varable and then put
this
> into the Select command?
>
> 2. With MySQL the dates are YYYY-mm-dd hh:mm:ss but in all the menu
choices
> through out CCS, It has the normal MS date choices (Long, short, etc.)
but
> not the MySQL - How do I set a date for Enter or Display?
>
> Thanks for any help.
>
> JCF
>
>

JCF
Posted: 09/04/2002, 10:11 PM

Hi Don

Thanks for your response.

I have tried something like that but I guess I am not doing it correctly.

PHP has a date("Y-m-d") function, I can use it at the prompt but not in CSS
it either gives an error or displays all the records?

Could you list the steps to do this.

JCF

"DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
news:al63ck$a0r$1@news.codecharge.com...
> No mySQL expertise here, but can you write a query/view/whatever in mySQL
> that inherently selects only today's rows? I mostly use SQL Server and do
> that sort of thing (there is a function "getdate()" that always returns
> today's date, so I SELECT where getdate()'s "day" component is equal to
the
> "day" from my records).
>
> For things like this it's nice to embed the "logic" of the WHERE clause on
> the server. This way, you don't have to code anything in CCS at all.
>
> don
>
>
> "JCF" <jcf@mail.org> wrote in message
>news:al5t5r$u7b$1@news.codecharge.com...
> > Hi All
> >
> > CCS, PHP, MySQL - I have some questions - I have take the Portal and
> > modified it for my use, the Data structure is only changed a little. I
> have
> > added some fields, such as description and date, etc.
> >
> > 1. How do I have the Events on the opening page filtered by the Current
> > Date - For example I would like to list only the Events for the next 7
> > days? - I have looked and I don't see how create a varable and then put
> this
> > into the Select command?
> >
> > 2. With MySQL the dates are YYYY-mm-dd hh:mm:ss but in all the menu
> choices
> > through out CCS, It has the normal MS date choices (Long, short, etc.)
> but
> > not the MySQL - How do I set a date for Enter or Display?
> >
> > Thanks for any help.
> >
> > JCF
> >
> >
>
>

RonB
Posted: 09/05/2002, 3:03 AM

Hi,

It's a bit confusing but the dropdown list wich enables you to choose a date
format in properties is also a textbox. You can just type the format you
want (dd-mm-yyyy for example) just remember to fill in the dbformat as
well(for mysql just type yyyy-mm-dd and remove the rest of the
line(HH:nn:ss).
As for the query to fetch only the next 7 days:
Use the query builder to build the normal query. After you have done this
switch(in query builder) from table to sql. The sql query will automaticaly
be shown. Now ad the following in the where section of the query:

and your_datefield >= now() or your_datefield <= date_add(now(), interval 7
DAY)

Substitue your_datefield for the column name in your tabel containing the
event dates.
You do not have to format the date in the query since everything is handles
on the sql level. The date format in the prperties box is just for
formatting the date as seen on the page. Now you will only see events that
happen today or for the next 7 days.

Hope this helps.

RonB

"JCF" <jcf@mail.org> schreef in bericht
news:al6p2l$g4q$1@news.codecharge.com...
> Hi Don
>
> Thanks for your response.
>
> I have tried something like that but I guess I am not doing it correctly.
>
> PHP has a date("Y-m-d") function, I can use it at the prompt but not in
CSS
> it either gives an error or displays all the records?
>
> Could you list the steps to do this.
>
> JCF
>
> "DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
>news:al63ck$a0r$1@news.codecharge.com...
> > No mySQL expertise here, but can you write a query/view/whatever in
mySQL
> > that inherently selects only today's rows? I mostly use SQL Server and
do
> > that sort of thing (there is a function "getdate()" that always returns
> > today's date, so I SELECT where getdate()'s "day" component is equal to
> the
> > "day" from my records).
> >
> > For things like this it's nice to embed the "logic" of the WHERE clause
on
> > the server. This way, you don't have to code anything in CCS at all.
> >
> > don
> >
> >
> > "JCF" <jcf@mail.org> wrote in message
> >news:al5t5r$u7b$1@news.codecharge.com...
> > > Hi All
> > >
> > > CCS, PHP, MySQL - I have some questions - I have take the Portal and
> > > modified it for my use, the Data structure is only changed a little. I
> > have
> > > added some fields, such as description and date, etc.
> > >
> > > 1. How do I have the Events on the opening page filtered by the
Current
> > > Date - For example I would like to list only the Events for the next 7
> > > days? - I have looked and I don't see how create a varable and then
put
> > this
> > > into the Select command?
> > >
> > > 2. With MySQL the dates are YYYY-mm-dd hh:mm:ss but in all the menu
> > choices
> > > through out CCS, It has the normal MS date choices (Long, short, etc.)
> > but
> > > not the MySQL - How do I set a date for Enter or Display?
> > >
> > > Thanks for any help.
> > >
> > > JCF
> > >
> > >
> >
> >
>
>

Shawn Mason
Posted: 09/05/2002, 8:48 AM

You know, you two (i.e. RonB and DonB) should be brothers <g>. Is this a
conspiracy or something?

--
Kindest Regards,

Shawn Mason,CCD,MCP
I.S. Software Design Associates

"RonB" <r.borkent@123chello.456nl> wrote in message
news:al7a6a$g23$1@news.codecharge.com...
> Hi,
>
> It's a bit confusing but the dropdown list wich enables you to choose a
date
> format in properties is also a textbox. You can just type the format you
> want (dd-mm-yyyy for example) just remember to fill in the dbformat as
> well(for mysql just type yyyy-mm-dd and remove the rest of the
> line(HH:nn:ss).
> As for the query to fetch only the next 7 days:
> Use the query builder to build the normal query. After you have done this
> switch(in query builder) from table to sql. The sql query will
automaticaly
> be shown. Now ad the following in the where section of the query:
>
> and your_datefield >= now() or your_datefield <= date_add(now(), interval
7
> DAY)
>
> Substitue your_datefield for the column name in your tabel containing the
> event dates.
> You do not have to format the date in the query since everything is
handles
> on the sql level. The date format in the prperties box is just for
> formatting the date as seen on the page. Now you will only see events that
> happen today or for the next 7 days.
>
> Hope this helps.
>
> RonB
>
> "JCF" <jcf@mail.org> schreef in bericht
>news:al6p2l$g4q$1@news.codecharge.com...
> > Hi Don
> >
> > Thanks for your response.
> >
> > I have tried something like that but I guess I am not doing it
correctly.
> >
> > PHP has a date("Y-m-d") function, I can use it at the prompt but not in
> CSS
> > it either gives an error or displays all the records?
> >
> > Could you list the steps to do this.
> >
> > JCF
> >
> > "DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
> >news:al63ck$a0r$1@news.codecharge.com...
> > > No mySQL expertise here, but can you write a query/view/whatever in
> mySQL
> > > that inherently selects only today's rows? I mostly use SQL Server
and
> do
> > > that sort of thing (there is a function "getdate()" that always
returns
> > > today's date, so I SELECT where getdate()'s "day" component is equal
to
> > the
> > > "day" from my records).
> > >
> > > For things like this it's nice to embed the "logic" of the WHERE
clause
> on
> > > the server. This way, you don't have to code anything in CCS at all.
> > >
> > > don
> > >
> > >
> > > "JCF" <jcf@mail.org> wrote in message
> > >news:al5t5r$u7b$1@news.codecharge.com...
> > > > Hi All
> > > >
> > > > CCS, PHP, MySQL - I have some questions - I have take the Portal and
> > > > modified it for my use, the Data structure is only changed a little.
I
> > > have
> > > > added some fields, such as description and date, etc.
> > > >
> > > > 1. How do I have the Events on the opening page filtered by the
> Current
> > > > Date - For example I would like to list only the Events for the next
7
> > > > days? - I have looked and I don't see how create a varable and then
> put
> > > this
> > > > into the Select command?
> > > >
> > > > 2. With MySQL the dates are YYYY-mm-dd hh:mm:ss but in all the menu
> > > choices
> > > > through out CCS, It has the normal MS date choices (Long, short,
etc.)
> > > but
> > > > not the MySQL - How do I set a date for Enter or Display?
> > > >
> > > > Thanks for any help.
> > > >
> > > > JCF
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Shawn Mason
Posted: 09/05/2002, 9:23 AM

Hey, maybe I'll change my handle to ShawnB...what do you think? <gd&r>


"Shawn Mason" <shawn@issda.com> wrote in message
news:al7ud1$mod$1@news.codecharge.com...
> You know, you two (i.e. RonB and DonB) should be brothers <g>. Is this a
> conspiracy or something?
>
> --
> Kindest Regards,
>
> Shawn Mason,CCD,MCP
> I.S. Software Design Associates
>
> "RonB" <r.borkent@123chello.456nl> wrote in message
>news:al7a6a$g23$1@news.codecharge.com...
> > Hi,
> >
> > It's a bit confusing but the dropdown list wich enables you to choose a
> date
> > format in properties is also a textbox. You can just type the format you
> > want (dd-mm-yyyy for example) just remember to fill in the dbformat as
> > well(for mysql just type yyyy-mm-dd and remove the rest of the
> > line(HH:nn:ss).
> > As for the query to fetch only the next 7 days:
> > Use the query builder to build the normal query. After you have done
this
> > switch(in query builder) from table to sql. The sql query will
> automaticaly
> > be shown. Now ad the following in the where section of the query:
> >
> > and your_datefield >= now() or your_datefield <= date_add(now(),
interval
> 7
> > DAY)
> >
> > Substitue your_datefield for the column name in your tabel containing
the
> > event dates.
> > You do not have to format the date in the query since everything is
> handles
> > on the sql level. The date format in the prperties box is just for
> > formatting the date as seen on the page. Now you will only see events
that
> > happen today or for the next 7 days.
> >
> > Hope this helps.
> >
> > RonB
> >
> > "JCF" <jcf@mail.org> schreef in bericht
> >news:al6p2l$g4q$1@news.codecharge.com...
> > > Hi Don
> > >
> > > Thanks for your response.
> > >
> > > I have tried something like that but I guess I am not doing it
> correctly.
> > >
> > > PHP has a date("Y-m-d") function, I can use it at the prompt but not
in
> > CSS
> > > it either gives an error or displays all the records?
> > >
> > > Could you list the steps to do this.
> > >
> > > JCF
> > >
> > > "DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
> > >news:al63ck$a0r$1@news.codecharge.com...
> > > > No mySQL expertise here, but can you write a query/view/whatever in
> > mySQL
> > > > that inherently selects only today's rows? I mostly use SQL Server
> and
> > do
> > > > that sort of thing (there is a function "getdate()" that always
> returns
> > > > today's date, so I SELECT where getdate()'s "day" component is equal
> to
> > > the
> > > > "day" from my records).
> > > >
> > > > For things like this it's nice to embed the "logic" of the WHERE
> clause
> > on
> > > > the server. This way, you don't have to code anything in CCS at
all.
> > > >
> > > > don
> > > >
> > > >
> > > > "JCF" <jcf@mail.org> wrote in message
> > > >news:al5t5r$u7b$1@news.codecharge.com...
> > > > > Hi All
> > > > >
> > > > > CCS, PHP, MySQL - I have some questions - I have take the Portal
and
> > > > > modified it for my use, the Data structure is only changed a
little.
> I
> > > > have
> > > > > added some fields, such as description and date, etc.
> > > > >
> > > > > 1. How do I have the Events on the opening page filtered by the
> > Current
> > > > > Date - For example I would like to list only the Events for the
next
> 7
> > > > > days? - I have looked and I don't see how create a varable and
then
> > put
> > > > this
> > > > > into the Select command?
> > > > >
> > > > > 2. With MySQL the dates are YYYY-mm-dd hh:mm:ss but in all the
menu
> > > > choices
> > > > > through out CCS, It has the normal MS date choices (Long, short,
> etc.)
> > > > but
> > > > > not the MySQL - How do I set a date for Enter or Display?
> > > > >
> > > > > Thanks for any help.
> > > > >
> > > > > JCF
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

JCF
Posted: 09/05/2002, 1:36 PM

Got it to work finally!!!!!

Here is the SQL - It uses the MySQL function called curdate()

SELECT *
FROM events
WHERE ( date_start >= curdate() )
ORDER BY date_start

Part of my problem was that I was using the single quotes around the
curdate() - don't need to do this.

Thanks for everones help

JCF

"RonB" <r.borkent@123chello.456nl> wrote in message
news:al7a6a$g23$1@news.codecharge.com...
> Hi,
>
> It's a bit confusing but the dropdown list wich enables you to choose a
date
> format in properties is also a textbox. You can just type the format you
> want (dd-mm-yyyy for example) just remember to fill in the dbformat as
> well(for mysql just type yyyy-mm-dd and remove the rest of the
> line(HH:nn:ss).
> As for the query to fetch only the next 7 days:
> Use the query builder to build the normal query. After you have done this
> switch(in query builder) from table to sql. The sql query will
automaticaly
> be shown. Now ad the following in the where section of the query:
>
> and your_datefield >= now() or your_datefield <= date_add(now(), interval
7
> DAY)
>
> Substitue your_datefield for the column name in your tabel containing the
> event dates.
> You do not have to format the date in the query since everything is
handles
> on the sql level. The date format in the prperties box is just for
> formatting the date as seen on the page. Now you will only see events that
> happen today or for the next 7 days.
>
> Hope this helps.
>
> RonB
>
> "JCF" <jcf@mail.org> schreef in bericht
>news:al6p2l$g4q$1@news.codecharge.com...
> > Hi Don
> >
> > Thanks for your response.
> >
> > I have tried something like that but I guess I am not doing it
correctly.
> >
> > PHP has a date("Y-m-d") function, I can use it at the prompt but not in
> CSS
> > it either gives an error or displays all the records?
> >
> > Could you list the steps to do this.
> >
> > JCF
> >
> > "DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
> >news:al63ck$a0r$1@news.codecharge.com...
> > > No mySQL expertise here, but can you write a query/view/whatever in
> mySQL
> > > that inherently selects only today's rows? I mostly use SQL Server
and
> do
> > > that sort of thing (there is a function "getdate()" that always
returns
> > > today's date, so I SELECT where getdate()'s "day" component is equal
to
> > the
> > > "day" from my records).
> > >
> > > For things like this it's nice to embed the "logic" of the WHERE
clause
> on
> > > the server. This way, you don't have to code anything in CCS at all.
> > >
> > > don
> > >
> > >
> > > "JCF" <jcf@mail.org> wrote in message
> > >news:al5t5r$u7b$1@news.codecharge.com...
> > > > Hi All
> > > >
> > > > CCS, PHP, MySQL - I have some questions - I have take the Portal and
> > > > modified it for my use, the Data structure is only changed a little.
I
> > > have
> > > > added some fields, such as description and date, etc.
> > > >
> > > > 1. How do I have the Events on the opening page filtered by the
> Current
> > > > Date - For example I would like to list only the Events for the next
7
> > > > days? - I have looked and I don't see how create a varable and then
> put
> > > this
> > > > into the Select command?
> > > >
> > > > 2. With MySQL the dates are YYYY-mm-dd hh:mm:ss but in all the menu
> > > choices
> > > > through out CCS, It has the normal MS date choices (Long, short,
etc.)
> > > but
> > > > not the MySQL - How do I set a date for Enter or Display?
> > > >
> > > > Thanks for any help.
> > > >
> > > > JCF
> > > >
> > > >
> > >
> > >
> >
> >
>
>

DonB
Posted: 09/05/2002, 5:00 PM

That's something you'll have to discuss with your family :-)


"Shawn Mason" <shawn@issda.com> wrote in message
news:al80e4$qho$1@news.codecharge.com...
> Hey, maybe I'll change my handle to ShawnB...what do you think? <gd&r>
>



   


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

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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