|
在access中增加农历支持模块.(1)
在Access中增加农历支持模块.
新建模块,复制下面两个函数. glgetnl(),strnl() 在查询中使用: select glgetnl(born) as nlborn from empolyee where glgetnl(born)>"05012" order by glgetnl(born) 上面的查询返回农历生日大于五月十二员工列表,并按农历生日排序. (声明:这两个函数不是从零开始写的,是修改了网上不知道谁的程序代码而来的. 到Google输入关键字VB 农历可以找到这篇文章的多处引用 本来是想在ASP中直接调用的,后来想到放到数据库中,但在Access中可以使用,在ASP中使用ADO无法调用.在调试中发现原数据中的1998农历闰月为小月而不是原代码中的大月,另修改了求干支算法.也没去和原作者联系,见谅.)
'输入date, 返回"mmlddyyyy" mm: 月份; l: 1,闰月,0,平常月; dd: 日; yyyy年份 Function glgetnl(ByVal gldate) Dim daList(111) '1900 to 1909 daList(0) = "010010110110180131" daList(1) = "010010101110000219" daList(2) = "101001010111000208" daList(3) = "010100100110150129" daList(4) = "110100100110000216" daList(5) = "110110010101000204" daList(6) = "011010101010140125" daList(7) = "010101101010000213" daList(8) = "100110101101000202" daList(9) = "010010101110120122" daList(10) = "010010101110000210" daList(11) = "101001001101160130" daList(12) = "101001001101000218" daList(13) = "110100100101000206" daList(14) = "110101010100150126" daList(15) = "101101010101000214" daList(16) = "010101101010000204"
|