如何在转发器中合并两个不同的列 [英] How to merge two different columns in a repeater

查看:75
本文介绍了如何在转发器中合并两个不同的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在sql server中有三个表,

[job,emp&创建工作后,用户可以为员工分配工作

n

工作前关闭,用户可以分配更多的员工或者可以删除指定的员工。



这里的问题是,如何维护开始日期n员工的截止日期,
这两个表[emp n emp_history]我有这两列(开始日期n结束日期)

因为,我必须通过合并两个表在一个转发器中显示它[emp n emp_history]。



转发器看起来像这样,

Hi guys,

I have three table in sql server,
[job, emp & emp_history]

once the job is created the user can assign employees to the job
n
before the job is closed the user can assign more employees or can remove assigned employees.

here the problem is, how to maintain Starting date n Ending date of an employee,
in both of these tables[emp n emp_history] i have these two columns (starting date n ending date)
because, i have to display it in one repeater by merging both the tables[emp n emp_history].

the repeater look like this,

--------------------------------------------------------------
jobID | Emp-ID | Emp-Name      | Starting Date | Ending Date |
--------------------------------------------------------------
1     |  01    | ABC           | 08/01/2014    | 08/30/2014  |
--------------------------------------------------------------
2     |  02    | DEF           | 08/01/2014    | 08/15/2014 *|
--------------------------------------------------------------
3     |  03    | GHI           | 08/16/2014 *  | 08/30/2014  |
--------------------------------------------------------------





任何人都可以帮助我,



谢谢



can anyone plz help me,

Thanks

推荐答案

您按照所需格式通过数据库查询获取数据,

after您可以轻松地执行此操作
you fetch your data by database query in your required format ,
after that you can easily do this


您好

两个表都有开始日期和结束日期字段,然后您必须决定要显示哪个表的字段。 br />
例如。

如果你想显示emp表的开始日期,那就写下emp.startindate。



当你使用超过您的查询中有1个表,有些字段的名称很常见,那么您需要编写TABLEANME.TABLEFIELD并获得结果。
Hello
Both table have starting date and ending date field then you have to decide which table's field do you want to display .
eg .
if you want to display starting date of " emp " table , then just write emp.startindate.

When you are using more than 1 tables in your query , and some fields' names are common then you need to write TABLEANME.TABLEFIELD and you ll get your result.


这篇关于如何在转发器中合并两个不同的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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