ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¦bEXCEL VBA¤¤ªºMS SQL¬d¸ß»yªk¡A¦p¦ó¥Î¿é¤Jªº¤è¦¡²£¥Í¡H

¦bEXCEL VBA¤¤ªºMS SQL¬d¸ß»yªk¡A¦p¦ó¥Î¿é¤Jªº¤è¦¡²£¥Í¡H

§ÚªºEXCEL VBA ¤¤¦³¤@¬q¬d¸ßMS SQL»yªk (............where ApplyDateTime Between '20120101' and '20121231' and Excuse='¯S¥ð°²'...........)¡A¸Ó¦p¦ó±N¤é´Á»P°²§Oªº³¡¤À¥ÎVBA¤å¦r¤è¶ô¤è¦¡¿é¤J¤é´Á½d³ò©M°²§O¥i¬d¸ß¥X§Ú­nªºµ²ªG¡HÁÂÁ¡I
PS¡G¦]¬°¦bVBA¤¤¥i¥H°õ¦æSQL»yªk¡A¬d¸ß¸ê®Æ¡A©Ò¥H§Ú·Q­n³o¬qSQL»yªk¦bVBA¤¤¥i¥H¥ÎÅܼƤ覡¥h¬d¸ß¡C
¿­·

¥»©«³Ì«á¥Ñ badboy01 ©ó 2012-12-7 22:13 ½s¿è
¦^´_  stillfish00

¥t½Ð±Ð¤j¤j¡A§Ú¦bEXCEL sheet¤¤³]­pªº«ö¶s­n«ç»òÂê©wµLªk«ö¥kÁä¥h½s¿è¥¨¶°ªº­ì©l½X¡H ...
badboy01 µoªí©ó 2012-12-7 18:13


§Ú¸Õ¥X¨Ó¤F¡A³]©w«OÅ@¦@¥Î¬¡­¶Ã¯¡A·PÁ¤j¤j¡I
¿­·

TOP

¦^´_ 10# badboy01
³o¤è­±§Ú¤]¤£¤Ó¼ô , ºëµØ°Ï¤º¦³¤@¨Ç«OÅ@¤u§@ªí©Îµ{¦¡½Xªº°Q½×¤]³\§A¯à°Ñ¦Ò¬Ý¬Ý

TOP

¦^´_ 8# stillfish00

¥t½Ð±Ð¤j¤j¡A§Ú¦bEXCEL sheet¤¤³]­pªº«ö¶s­n«ç»òÂê©wµLªk«ö¥kÁä¥h½s¿è¥¨¶°ªº­ì©l½X¡HÁÂÁ¡I(¥¿±`¤U¤@¯ë·Æ¹«¥kÁä¥i¥H¿ï¾Ü«ü©w¥¨¶°)
¿­·

TOP

¦^´_ 8# stillfish00

·PÁÂ~~¤j¤j¦¨¥\¤F~¤§«e·d¦n¤[³£·d¤£©w¡A¼Ò²Õ¤]¥i¥H¥Î¤F~~·P®¦^____^
¿­·

TOP

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2012-12-7 17:28 ½s¿è

¦^´_ 6# badboy01
OK , ©Ò¥H§A¬Oµ{¦¡¼g¦b¼Ò²Õ¤º ,
°²³]§A¬Oª½±µ¦b¤u§@ªí1 (¤u§@ªí¦WºÙ) ,  ´¡¤JActiveXªº¤å¦r¤è¶ô
³o¼Ëªº¸Ü§AªºTextbox1­n«ü©w¬O­þ­Ó¤u§@ªí ,
¤]´N¬O§â­ì¥»ªº Textbox1.Text §ï¼g¦¨  sheets("¤u§@ªí1").Textbox1.Text
Textbox2¦P²z

TOP

¦^´_ 5# c_c_lai


    §Ú«ö·Ó¤j¤j¤è¦¡¦n¹³¤£¦æ(¼Ò²Õ¤è¦¡)¡A¤£¹LÁÙ¬OÁÂÁ´£¨Ñ¤èªk¡C
¿­·

TOP

¦^´_  badboy01
sStartDate =TextBox1.Text
sEndDate =TextBox2.Text
stillfish00 µoªí©ó 2012-12-7 16:31


§Ú¤j·§µo²{°ÝÃD¦b­þ¸Ì¤F¡C§Ú³£¬O¥Î¼Ò²Õ¤è¦¡¨Ó³]­p¡A§Ú¬Oª½±µ¦bEXCEL¤W³]­p¤å¦r¤è¶ô¡A©Ò¥H¤@ª½¦³¿ù»~¡A¦ý¬O§Ú´¡¤Jªí³æ¦b«ö·Ó¤j¤jªº¤è¦¡´N¦¨¥\¤F¡A¥u¬O¦pªG§Ú¦bEXCEL sheet ¤W´N¦³°ÝÃD~~§ä¤£¥X­ì¦]= ="¡A¤£¹LÁÙ¬O·PÁ¤j¤j¡A²×©ó·d©w¤F¡A·P®¦¡I
¿­·

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-12-7 16:42 ½s¿è

¦^´_ 3# badboy01
  1. where ApplyDateTime Between '" & Format(TextBox1.Text, "yyyymmdd") & "' AND '" & Format(TextBox2.Text, "yyyymmdd") & "' and Excuse='¯S¥ð°²'
½Æ»s¥N½X

TOP

¦^´_ 3# badboy01
sStartDate =TextBox1.Text
sEndDate =TextBox2.Text

TOP

        ÀR«ä¦Û¦b : ¤f»¡¤@¥y¦n¸Ü¡A¦p¤f¥X½¬ªá¡F¤f»¡¤@¥yÃa¸Ü¦p¤f¦R¬r³D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD