如何解决月年问题 [英] how to solve month year problem

查看:60
本文介绍了如何解决月年问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这项工作是指每月向公司中的所有工人分配奖励金额.

进入页面
-----------
在进入页面中,我们选择一个ddlworkernameddlyearddlmonth,然后按生成"按钮.

结果显示了所有类型的激励措施,百分比和ddlstaus(是/否).

当我们选择是"选项时,所选的激励百分比将根据他的薪水计算并显示出他增加的薪水金额并将其保存到tbl.当我们不选择任何选项时,将无法进行计算
注意:-月,年是表中的两个不同字段

报告页面
-----------
我的工作将要从上面的输入页面进行报告.
在我的页面中有
1.从日期起:ddlmonth(月)和ddlyear(年)例如:-01/2011
2.迄今为止:ddl(月)和ddl(年),例如:-02/2012
3.生成按钮

并在网格中显示结果.

网格字段包含(工人名称,激励类型,IncrementedSalaryAmt,月,年).

查询
-----

This work refers to assign incentive amount per month to all workers in a company.

Entry Page
-----------
In the entry page we select a ddlworkername, ddlyear, ddlmonth then press generate button.

The results shows all type of incentives, percentage and a ddlstaus(yes/no).

When we select yes option the selected incentives percentage calculated with his salary and shows his incremented salary amount and save it to tbl. When we select no option the calculation not be done
note:- month, year are two different fields in table

Report Page
-----------
My work is about to take report from the above entry page.
in my page there are
1. from date : ddlmonth(month) and ddlyear(Year) ex:- 01/2011
2. To date : ddl(month) and ddl(Year) ex:- 02/2012
3. generate button

And shows a result in grid.

Grid fields contains (Name of worker, incentive Type, IncrementedSalaryAmt, month, year).

Query
-----

select name,incentive,IncrementedSalaryAmt,month,year from tblincentive 
where year between 2011 and 2012
and month between 01 to 02



从此查询中,结果仅显示不需要的2011年1月,2月和2012年1月的数据.

我想显示从2011年1月至2012年2月的所有数据.

谁能给我解决方案.



From this query the results only shows the datas in January, February of 2011 and 2012 it is not I need.

I want to display all the datas from January/2011 to February/2012.

Can anyone give me a solution.

推荐答案

IMO,您不应该在几个月,几年之内使用单独的字段.而是使用本机数据类型作为日期(例如date),请参阅: http://msdn. microsoft.com/en-us/library/ms187752.aspx [ ^ ]

更改之后,您可以轻松比较日期或计算两个日期之间的差,依此类推.
IMO you shouldn''t use separate fields for months, years and so on. Instead use the native data type for dates (for example date), see: http://msdn.microsoft.com/en-us/library/ms187752.aspx[^]

After that change you can easily compare dates or calculate difference between two dates and so on.


这篇关于如何解决月年问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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