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 -> PHP

 query the form and enter result into form control

Print topic Send  topic

Author Message
ddmcse

Posts: 24
Posted: 03/10/2008, 1:31 PM

if I use mysql query browser
SELECT Date_Art_Received as startdate,
Published_Date as enddate,
to_Days(Published_Date)-to_days(Date_Art_Received)as number_of_days FROM YankeeProofing

the results in "number of days " is what i want

i have a add /submit form with "Date_Art_Received" and "Published_Date"
i want to subtract "Published_Date" - "Date_Art_Received" and stuff the answer into a text box called "Lead_Time"

i've been try to get something to fly in beforeUpdate

i get no runs , no hits . no errors

just a zero in "Lead_Time"




it's just as easy as dumping this code in the

$result = "SELECT Date_Art_Received as startdate,
Published_Date as enddate,
to_Days(Published_Date)-to_days(Date_Art_Received)as number_of_days FROM
YankeeProofing "

$Yankeeproofing1->Lead_Time->SetValue($result);




_________________
http://www.buyrfidlabels.com
View profile  Send private message
ddmcse

Posts: 24
Posted: 03/11/2008, 1:06 PM

function dateDiff($dformat, $endDate, $beginDate)  
{  
$date_parts1=explode($dformat, $beginDate);  
$date_parts2=explode($dformat, $endDate);  
$start_date=gregoriantojd($date_parts1[0], $date_parts1[1], $date_parts1[2]);  
$end_date=gregoriantojd($date_parts2[0], $date_parts2[1], $date_parts2[2]);  
return $end_date - $start_date;  
}  
  
  
  
	   
$date1 = $YankeeProofing1->Published_Date->GetValue();  
$date2 = $YankeeProofing1->Date_Art_Received->GetValue();  
$result = dateDiff("/",$date1,$date2);  
  
 //  $YankeeProofing1->Lead_Time->SetValue($result);  
 $date1 = CCFormatDate($YankeeProofing1->Published_Date->GetValue(),array("ShortDate"));  
 // $date1 = CCFormatDate($YankeeProofing1->Published_Date->GetValue(),array("yyyy", "-", "mm", "-", "dd"));  
   
//$YankeeProofing1->Lead_Time->SetValue($result);  
$YankeeProofing1->Lead_Time->SetValue($YankeeProofing1->Published_Date->GetValue());  
  
  
  
  
I'm making progress but I can seem to get it completely if i get CCFormatDate working at all i get it the yyyy part i.e. 2008
_________________
http://www.buyrfidlabels.com
View profile  Send private message
ddmcse

Posts: 24
Posted: 03/11/2008, 3:39 PM

$date1 = $YankeeProofing1->Published_Date->GetValue();
$date2 = $YankeeProofing1->Date_Art_Received->GetValue();
$result = dateDiff("/",$date1,$date2);

// $YankeeProofing1->Lead_Time->SetValue($result);


thanks
your post > wkempees solved the puzzle for me

GetValue
should be GetText
_________________
http://www.buyrfidlabels.com
View profile  Send private message
wkempees


Posts: 1679
Posted: 03/11/2008, 4:37 PM

?? MyPost ??

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
ddmcse

Posts: 24
Posted: 03/11/2008, 5:05 PM

yeah i needed "CCFormatDate" help
searched for CCFormatDate and went through posts
_________________
http://www.buyrfidlabels.com
View profile  Send private message
wkempees


Posts: 1679
Posted: 03/12/2008, 2:50 AM

8-)
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
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.