an question regarding the RDP

Dear folks,

I have a contract class where i am getting month and year, month is created as enum and year is created as year base… in RDP class the loop we are getting some data to be printed , I have debugged loop by loop found that

//get the error qty prodjournal prod

if(years==year(prodTable.DlvDate) && month= mthofYr(prodTable.DlvDate)

{

//do some thing

}

year and month are coming from contract class yearbase, enum respectively

now i wanted to get the year and month from the prod table while debugging it looks like

this is not esxecuting.

is this correct

You wrote that “get the error”, but what’s the error? Can you also show the failing code?

while select prodTable where prodTable.RouteId==route.RouteId

{

//get the item and dlv time

//get the itemid of prodtable to

tmptable.ItemId=prodTable.ItemId;

while select prodJournalProd where prodJournalProd.ProdId==prodTable.ProdId

{

if(years==year(prodTable.DlvDate) && month==mthOfYr(prodTable.DlvDate))

{

// tmptable.month=month;

//tmptable.years=years;

//i used above statement was used for testing purpose as the data are not coming please note month and year like 2014 and june is coming from contract class

// tmptable.day1daysum=100;

endDate = Global::dateEndMth(mkdate(01,month,years));

NoOfDays = dayOfMth(endDate);

//for a loop for all the days

for(i=1;i<=NoOfDays;i++)

{

switch(i)

{

case 1:

{

//check the delivery time as day or night 6.am to 6 pm

// if(prodTable.DlvTime = >(186060) && prodTable.DlvTime < =(66060))

if(prodTable.DlvTime >= (186060) && prodTable.DlvTime <= (66060))

{

//night shift sum

day1nightsum =day1nightsum+prodJournalProd.qtyError;

// day1nightsum=20; //for testing purpose alone

}//nght shift ends here

else

{

//dayshift sum

day1daysum= day1daysum+prodJournalProd.qtyError;

//tmptable.dayshift=dayshiftsum;

}//dayshift loop ends here

}//case1 ends here

i am trying to print dayshift sum but it is not coming inside the loop

if(years==year(prodTable.DlvDate) && month==mthOfYr(prodTable.DlvDate)) this statement is not working here…

the failing code is given below… from the above code…

if(years==year(prodTable.DlvDate) && month==mthOfYr(prodTable.DlvDate))

{

// tmptable.month=month;

//tmptable.years=years;

//i used above statement was used for testing purpose as the data are not coming please note month and year like 2014 and june is coming from contract class

// tmptable.day1daysum=100;

endDate = Global::dateEndMth(mkdate(01,month,years));

NoOfDays = dayOfMth(endDate);

//for a loop for all the days

for(i=1;i<=NoOfDays;i++)

{

switch(i)

{

case 1:

{

//check the delivery time as day or night 6.am to 6 pm

// if(prodTable.DlvTime = >(186060) && prodTable.DlvTime < =(66060))

if(prodTable.DlvTime >= (186060) && prodTable.DlvTime <= (66060))

{

//night shift sum

day1nightsum =day1nightsum+prodJournalProd.qtyError;

// day1nightsum=20; //for testing purpose alone

}//nght shift ends here

else

{

//dayshift sum

day1daysum= day1daysum+prodJournalProd.qtyError;

//tmptable.dayshift=dayshiftsum;

}//dayshift loop ends here

}//case1 ends here

What in if(years==year(prodTable.DlvDate) && month==mthOfYr(prodTable.DlvDate)) doesn’t work? What are value of years, month and prodTable.DlvDate? It’s much more likely that the problem is in your data or your logic than in kernel functions or == operator.

If you expect the values to come from a data contract but it doesn’t happen, either your data contract is not implemented correctly (check signatures of accessor methods and whether there is DataMemberAttribute) or you the problem is in how you’re assigning values to your variables.

yes 1.you are right if(years==year(prodTable.DlvDate) && month==mthOfYr(prodTable.DlvDate)) under this loop it is not working

  1. the vaulue for month is enum which i have created where user can select from jan to december any month and year like 2011 or 2012, 2014 we have created a year from year Base year

and the data contract class looks fine as it is not showing any error also… implemetated the data contract class correctly upto from my knowledge…