在休假管理项目中...需要对日期进行计数 [英] In Leave managment project ...counting the dates are required

查看:98
本文介绍了在休假管理项目中...需要对日期进行计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是,当我在这里使用两个文本框时,可以给定一个用于日期的文本框,而可以给另一个用于日期的文本框....这里计算天数以及星期六,星期日和其他限制假日不算数....例如,当我将两个假期(如星期五)放到星期一时,仅显示两天....所以请给代码

my question is to be that when i use the two text boxes here one textbox for from date and another textbox for to date can be given .... here counting the num of days and also saturday,sunday and other restricted holidays are not counting .... for example when i take the two holidays like friday to monday only two days are displayed .... so plz give the code

推荐答案

您需要将日期放入 DateTime [ DateTimePicker [ TimeSpan [
You need to get your dates into DateTime[^] objects, either via some conversion process or by using DateTimePicker[^]s. You can then use the TimeSpan[^] class to calculate the number of days between the dates. Checking for weekends is just a matter of mathematics; checking for public holidays requires some locally defined tables.


您可以尝试使用此
hi try with this
select *  from
 t01_user where datename(dw,date) not in ('Saturday','Sunday')




问候.
pal




regards.
pal


看看你后面我可以得到你的代码
see behind you i can get u the code


这篇关于在休假管理项目中...需要对日期进行计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆