• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in retrieving single digit date and month

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Sir,
I have the following code. Currently when I insert date in this format 1984/11/14 and also in this format 1984/11/4 and retrieve the following two dates, I could successfully populate the dates into the corresponding fields in the form. But earlier in the database, there are some records created in the following formats:
1984/3/1 and 1987/10/4(i.e.,yyyy/mm/dd).In the form when I try to populate them into their corresponding fields I am able to populate only 1984 into the year filed in the first case and in the second case I could populate 1987 and 10 into the year and month fields. I could not populate the values of the records with single digit either in month or day fields.
By observing the code, could you let me know what needs to be done in order to populate the previously created records with the single digit month and date.

Code:
submitForm.elements[evl(i+1)].name = "dd_crmstart"submitForm.elements[evl(i+1)].value = field2

submitForm.elements[evl(i+2)].name = "mm_crmstart"
submitForm.elements[evl(i+2)].value = field3

submitForm.elements[evl(i+3)].name = "yy_crmstart"
submitForm.elements[evl(i+3)].value = field4

submitForm.method="post";

onSave(submitForm);

};



String strSQL = "";

strSQL ="select crmtype_code value, item display from code_crmtype order by 2" ;
db.setSQL( strSQL ) ;
db.query() ;
CRMEventVector = db.getSelectionList() ;


db.setSQL( "select LPAD(to_char(month_code),2,'0') value , item display from code_month order by 1" ) ;
db.query() ;
monthVector = db.getSelectionList();


db.setSQL( "select LPAD(to_char(day_code),2,'0') value , item display from code_day order by 1" ) ;
db.query() ;
dayVector = db.getSelectionList();
 
reply
    Bookmark Topic Watch Topic
  • New Topic