基于最新条目提取数据的逻辑 [英] Logic For Extracting data based on latest Entry

查看:48
本文介绍了基于最新条目提取数据的逻辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<pre><pre lang="text"><pre lang="text">

您好我需要一个逻辑来根据日期提取数据。



员工每天输入数据,我们提供有效日期的补贴,我的问题是如果我们设置有效日期的补贴,例如:2013年9月1日,津贴应于2013年1月9日起生效。如果员工进入第29或第30项,津贴应来自我们在2013年1月9日之前更新的津贴。如果员工进入2013年9月9日,津贴应该是新的。如何计算出logic.pls帮助我。

Hello every body i need a logic for Extracting the data based on dates.

Employees enter the data every day,we offer allowances with effective dates, my problem is if we set allowance with effective date for eg:01/09/2013 the allowance should be effective from 01/09/2013.if the employee enters 29th or 30th entry the allowance should come from allowance that we updated before 01/09/2013.if employee enters for 01/09/2013 the allowance should be new.How to work out the logic.pls help me.

推荐答案

select  
AllownceID, effectiveDate
from tableAllownce 
where effectiveDate <= @Salarydate 
Order by effectiveDate desc



快乐编码!

:)


Happy Coding!
:)


这篇关于基于最新条目提取数据的逻辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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