如何在数据中显示数据? [英] How Can I Display The Data In Data Wise?

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

问题描述

这里我创建了一个BLOG网站。我的要求是在前端我有这些控件



日期:

消息:

关键词:

主题:

提交(按钮)



我们进入所有领域然后按提交数据将存储在数据库中并显示仅消息和日期。

赞赞

2014:

一月

Febraury

三月





。十二月



当我们选择一月时它会显示一月份的消息使用Date Wise的月份。

但是在我的表中我只有Date列,没有Month.Here我将根据Date显示月份名称。我可以这样做吗?

给我回复。

我希望你能理解。请帮助我

解决方案

你可以从你的约会中提取月份,



例如

 选择 DateName(mm,getdate())





同样的方式你也可能需要年份



 选择 Datepart(YY,getdate())





通过日期列代替getdate()


Here iam creating one BLOG site.My Requirement is In Front end i have these controls

Date:
Message:
Keywords:
Subject:
Submit(Button)

we entering all fields and press Submit The Data Will be Stored in DB and displays Only Message and Date.
Like
2014:
January
Febraury
March
.
.
.December

When we select january it shows the Messages in January month with Date Wise.
but in my Table i have only Date column,there is no column for Month.Here i will display the month names based upon the Date.how can i do it?
give me reply.
I hope you understand.pls help me

解决方案

You can extract the month from your date,

E.g.

select DateName(mm,getdate())



Same way you may also need Year also

select Datepart(YY,getdate())



Pass your date column in place of getdate()


这篇关于如何在数据中显示数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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