localhero Posted January 20, 2007 Report Share Posted January 20, 2007 (edited) Ir tabulas lauks "datums" formātā date. Ir vaicājums: SELECT EXTRACT(MONTH FROM datums) as 'menesis' FROM tabula; Probl�“ma tāda ka piem�“ram Maijs tiek izvadīts kā 5 nevis 05 kā man grib�“tos. Uzrakstot SELECT * FROM tabula, datums ir 05 formātā. Varbūt kāds ir saskāries ar šādu probl�“mu. Edited January 20, 2007 by localhero Link to comment Share on other sites More sharing options...
bubu Posted January 20, 2007 Report Share Posted January 20, 2007 Un kur ir problēma? Vai to vispār drīkst saukt par problēmu?!? Manuāli kā vienmēr nemākam/negribam atšķirt... grr. http://dev.mysql.com/doc/refman/4.1/en/str...l#function_lpad LPAD(x, 2, '0') Link to comment Share on other sites More sharing options...
localhero Posted January 21, 2007 Author Report Share Posted January 21, 2007 Paldies bubu. ta nu gluzi nav ka neatskiru manuali. Nevareju atrast varbut ne tajaa virzienaa mekleeju. Bet nu paldies enivej. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted January 21, 2007 Report Share Posted January 21, 2007 hm... tieshaam to nosaukt par probleemu !!! paskat Seit .. DATE_FORMAT() un dabuusi aaraa kaa vien veelies... Link to comment Share on other sites More sharing options...
andrisp Posted January 21, 2007 Report Share Posted January 21, 2007 SELECT DATE_FORMAT(datums, '%m') Vispār iekš mysql ir miljons fju priekš datumiem - tākā vajag tikai pameklēt. Link to comment Share on other sites More sharing options...
Recommended Posts