ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 14th, 2003, 01:53 AM
icepricessa's Avatar
icepricessa icepricessa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 199 icepricessa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 10 m 38 sec
Reputation Power: 6
Exclamation can't display table colours

hi there i have to compare the datebase date(expirydate) with the server's date and if it is two weeks(server date) before the expirydate(database) the display changes
someone pls tell me what's wrong? i can't seem to get the right display.... the second if statement for the <td> doesnt seem to be working
PHP Code:
'If the created date in the database date is today's date than the colour of the whole    row will be blue if were created yesterday the row would be light yellow in color
  
If (objRS("Created")) = created then
  Response
.Write "<TR bgcolor='#95FFFF'><td><div class='Change'>"&y&"</div></td>"  
  
ELSE ' it will be light yellow
  Response.Write "<TR bgcolor='
#FFFFE6'><td><div class='Change'>"&y&"</div></td>"
  
End If
 

'over here it will check and compare the server's date with the database date.. if the srrver date is 2 weeks beofore the expiry date than it will be red else it will be normal
  
IF DATEDIFF("d",(FormatMediumDate(objRS("ExpiryDate"))),FormatMediumDate(created)) = 14 THEN
  Response
.Write "<td bgcolor='#FF0099'>"
  
Else 
  
Response.Write "<td>"
  
End If 

Last edited by icepricessa : October 14th, 2003 at 01:56 AM.

Reply With Quote
  #2  
Old October 14th, 2003, 07:27 AM
Agarash Agarash is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: South Africa
Posts: 53 Agarash User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 35 sec
Reputation Power: 6
i cant really see any thing wrong, only that maybe your not closing your <tr> tag with a </tr>??

but im sure it cant be this simple.
__________________
"Morgoth i Cried
All Hope is Gone
But i Swear REVENGE
Hear my Oath!!"

Reply With Quote
  #3  
Old October 14th, 2003, 09:44 PM
icepricessa's Avatar
icepricessa icepricessa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 199 icepricessa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 10 m 38 sec
Reputation Power: 6
hi there i have to compare the datebase date(expirydate) with the server's date and if it is two weeks(server date) before the expirydate(database) the display changes

someone pls tell me what's wrong? i can't seem to get the right display.... the second if statement doesnt seem to be working

i've done a response.write and i got a difference of 14 days however, the particular 'box' which the expirydate is in does not change colour.. here's what i did

PHP Code:
 created Date() 

If (
objRS("Created" )) = created then 
Response
.Write "<TR bgcolor='#95FFFF'><td><div class='Change'>"&y&"</div></td>" 
ELSE ' it will be light yellow 
Response.Write "<TR bgcolor='
#FFFFE6'><td><div class='Change'>"&y&"</div></td>" 
End If 
'this will check and compare the server's date and the database expiry date
'If it is 2 months prior to the expirydate in the database than 
If DateDiff("d", FormatMediumDate(objRS("ExpiryDate" )), FormatMediumDate(created)) = 14 Then 
Response.Write "<td bgcolor='
#FF0099'>" 
Else 
Response.Write "<td>" 
End If 

'This gets the expirydate in the database and displays the value 
If IsEmpty(objRS("ExpiryDate" )) Or IsNull(objRS("ExpiryDate" )) then 
Response.Write "<div class='
Change'>not entered</div>" 'if there is no date in the database 
Else 
Response.Write "<div class='Change'>"&FormatMediumDate(objRS("ExpiryDate" ))&"</div>" 
Response.Write "DateDiff: "&DATEDIFF("d",(FormatMediumDate(objRS("ExpiryDate" ))),FormatMediumDate(created)) 
End If 
Response.Write "</td>" 


advise someone???

Reply With Quote
  #4  
Old October 14th, 2003, 10:40 PM
icepricessa's Avatar
icepricessa icepricessa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 199 icepricessa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 10 m 38 sec
Reputation Power: 6
why can;t this bit of codework?

Code:
DateDiff("m", FormatMediumDate(created), FormatMediumDate(objRS("ExpiryDate"))) = 1

Reply With Quote
  #5  
Old October 15th, 2003, 02:24 AM
pda8333 pda8333 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 216 pda8333 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 6 m 31 sec
Reputation Power: 6
i can't see any errors also.

- are both your dates the same format (i.e, mm/dd/yyyy or dd/mm/yyyy) when comparing using the DateDiff?
- are both your dates the same field type (i.e datetime field)?
sometimes we accidentally compare a string with a datetime field, so it can't compare.

anyway, you can try this link though.

http://www.w3schools.com/vbscript/func_datediff.asp
__________________
Hope this helps.

Mike
Royal Selangor Pewter

"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

Reply With Quote
  #6  
Old October 15th, 2003, 02:52 AM
icepricessa's Avatar
icepricessa icepricessa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 199 icepricessa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 10 m 38 sec
Reputation Power: 6
thanks pda8333

Reply With Quote
  #7  
Old October 15th, 2003, 03:53 AM
pda8333 pda8333 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 216 pda8333 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 6 m 31 sec
Reputation Power: 6
can it work already? what was wrong then?

Reply With Quote
  #8  
Old October 15th, 2003, 04:08 AM
icepricessa's Avatar
icepricessa icepricessa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 199 icepricessa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 10 m 38 sec
Reputation Power: 6
lol.. it seems that my placing of the expirydate and the today's date made a difference lol
i changed datedif("d", RS5("expirydate"), date) to datediff("d",date,RS5("expirydate"))

o.O

Reply With Quote
  #9  
Old October 15th, 2003, 08:54 AM
pda8333 pda8333 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 216 pda8333 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 6 m 31 sec
Reputation Power: 6
good for u.

Reply With Quote
  #10  
Old October 15th, 2003, 08:12 PM
icepricessa's Avatar
icepricessa icepricessa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 199 icepricessa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 10 m 38 sec
Reputation Power: 6
keke thanks... *sigh of relief* finally one problem down :P

Reply With Quote
  #11  
Old October 16th, 2003, 01:27 AM
pda8333 pda8333 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 216 pda8333 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 6 m 31 sec
Reputation Power: 6
u mean u have more than 1 problem?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > can't display table colours


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT