EasyCFM.COM ColdFusion Forums / Coding Help! / Calendar help

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Calendar help -- page: 1 2

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

125pr
04-22-2006 @ 6:59 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 68
Joined: Oct 2005

I thanks all Members, Who provide great help for solving the questions, I am on to built a calendar. I have built age.cfm, checks the entries from the databasethe one and It displays very Ok

Now, I want that It should be like an Event Calendar, I tried, The link will sent the user to next page and URL passed are page.cfm?month=4&day=21&year=2006, The Page.cfm checks the entries from the database and shows the records related to the date.

But here, M records are not showing, query is Executed successfully and No records are shown, still there are records in the database, and Once the day passed, say today is 22, it shows the event for 22, tomorrow 23, it dows not events for 22 then, it shows for 23 instead.

if members understood what i want to say, plz help me with this.



Gurpreet Singh Randhawa
www.randhawaz.com

megan
04-22-2006 @ 8:03 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

Hi

My ESP is not working today, can you show us your code (query & output of query) thanks, megan

We have art so that we shall not die of reality ~ Nietzsche

125pr
04-22-2006 @ 8:30 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 68
Joined: Oct 2005

Yes Megan, Here is The query from where the link is Coming.

<A HREF = "events_calendar.cfm?day=#isday#&month=#month#&year=#year#"> #isday# </A>

where isday picks the recent say today's day

where the event happen, the code is:

<cfquery name="events" datasource="#source#">
SELECT downloads.title
FROM downloads
WHERE downloads.dateadded = #month#/#day#/#year#
</cfquery>
<cfoutput query="events">
<table width="100%" border="0">
  <tr>
    <td>Title</td>
    <td>#events.News#</td>
  </tr>
</table>
</cfoutput>

     

Gurpreet Singh Randhawa
www.randhawaz.com

This message was edited by 125pr on 4-22-06 @ 8:31 AM

megan
04-22-2006 @ 11:58 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

ok thanks, have you tried:

WHERE (month(downloads.dateadded) = #url.month#)
AND (day(downloads.dateadded) = #url.day#)
AND (year(downloads.dateadded) = #url.year#)

thanks, megan


We have art so that we shall not die of reality ~ Nietzsche

125pr
04-22-2006 @ 1:41 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 68
Joined: Oct 2005

It shows Me this type Of Error:

Error Executing Database Query. [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
The error occurred on line 6.

Gurpreet Singh Randhawa
www.randhawaz.com

megan
04-22-2006 @ 1:45 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

ok, what is on line 6 and also the lines on either side (5 & 7) also could you show me what the date in your date field looks like (just copy a sample date from your database dateadded field and paste it in your post.  thanks, megan

We have art so that we shall not die of reality ~ Nietzsche

125pr
04-22-2006 @ 1:51 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 68
Joined: Oct 2005

These are Line Numbers: 5,6,7,8
AND (day(downloads.dateadded) = #url.day#)
AND (year(downloads.dateadded) = #url.year#)
</cfquery>
<cfoutput query="events">

I Debugged the calendar.cfm, and checked that variables are passed as

URL Parameters:
DAY=22
MONTH=4
YEAR=2006

Date in my access database store as:

21/04/2006

and I have provided the Field as textbox in access instead of datetime

ok

Gurpreet Singh Randhawa
www.randhawaz.com

125pr
04-22-2006 @ 2:02 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 68
Joined: Oct 2005

Hey, Thanks megan, My One Problem Sorted out, The error is removed,

I was misspelling the name of the query, ok I am sorry

Thanks Megan, It is working Now, and as I said It is working only for the day that I am posting, means It shows the downloads for for 22 only, Not of 21 what the matter could be










22/04/2006

Gurpreet Singh Randhawa
www.randhawaz.com

megan
04-22-2006 @ 2:05 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

ok - try changing the date field to datetime instead of text (the database does not know the date is a date if you have the field set to text, it thinks the date is a regular string)

and when you insert a date into the date field use the createODBCdatetime() function like so

#createODBCdatetime(mydatevar)#

and when you pull the date from the database you can then format it like this

#dateFormat(downloads.dateadded, "dd/mm/yyyy")#

let me know how that works

regards, megan

We have art so that we shall not die of reality ~ Nietzsche

megan
04-22-2006 @ 2:09 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

sorry, did not see your second post as for your comment in the second post, it is giving you exactly what you asked for - where the day = 22, if you want 21 then url.day has to = 21 if you want between dates then you have to use the between operator (between this date and that date)

We have art so that we shall not die of reality ~ Nietzsche

PAGE: 1 2

Website Designed and Developed by Pablo Varando.