在mssql中按dd / mm / yyyy的dd排序 [英] Sort by dd from dd/mm/yyyy in mssql
本文介绍了在mssql中按dd / mm / yyyy的dd排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
获取记录时输入的值dd匹配dd / mm / yyyy而不是输入dd / mm / yyyy
我尝试过:
从tbl_MonthleyIntrest中选择*
其中tbl_MonthleyIntrest.DateTime ='13';
Get the records when entered value dd matches in dd/mm/yyyy instead of entering dd/mm/yyyy
What I have tried:
select * from tbl_MonthleyIntrest
where tbl_MonthleyIntrest.DateTime = '13';
推荐答案
SELECT [YourDate] FROM [YourTable] WHERE DAY([YourDate])= 14
SELECT [YourDate] FROM [YourTable] WHERE DAY([YourDate])=14
尝试:
Try:
SELECT * FROM tbl_MonthleyIntrest
WHERE DAY(tbl_MonthleyIntrest.DateTime) = 13
忽略 - 我把它读成MySql,而不是MSSql。
试试:
Ignore that - I read it as MySql, not MSSql.
Try:
SELECT * FROM tbl_MonthleyIntrest
WHERE DATEPART(dd, tbl_MonthleyIntrest.DateTime) = 13
这篇关于在mssql中按dd / mm / yyyy的dd排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文