如何搜索之间的日期 [英] How to search for date between

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

问题描述

大家好......



我目前在网上投票系统比较狡猾,我希望投票能够在特定日期进行投票......

如果投票日期尚未到达,选民不应该投票,当他们尝试点击按钮投票时,应该让他们知道日期尚未到达......



问题





1.如何搜索此类代码在谷歌

2.如何编写商店程序



如果你有参考链接你欢迎给我这个
i会帮助你的帮助

解决方案

这就是我理解你的问题,让我说你有一个现有的表名tblVotes

你已经拥有了ff选民的数据。字段



VotingDate - 您说系统将只接受的实际投票日期

IsVoteAccepted - 表示投票是否被接受的布尔字段< br $>


//变量

VotedDate - 这是用户投票的时候



Sp可能看起来像这样



  USE 投票
GO
CREATE PROCEDURE usp_Votes
@ VoteDate 日期
AS

更新 tblvotes
SET IsVoteAccepted = 1
WHERE VotingDate< = @ VoteDate
GO


Hi everyone...

I am currently bizy with online voting system and i want the vote to be for a specific dates...
if the vote date is not yet reach, the voter should not able to vote, when they try to click the button vote it should let them know that the date is not yet reach...

PROBLEM



1. How do i search such code on google
2. How do i write the store procedure

if you have a reference link you are welcome to give it to me
i will appriciate your help

解决方案

This is how I understand your questions, let say you have an existing table name tblVotes
and you already have data of voters with the ff. fields

VotingDate - the actual voting date which you said the system will only accept
IsVoteAccepted - boolean field indicating if the vote is accepted

//variable
VotedDate - this is when the user cast their votes

Sp might look like this

USE Votes
GO
CREATE PROCEDURE usp_Votes
    @VoteDate Date
AS 

     UPDATE tblvotes
     SET    IsVoteAccepted = 1
     WHERE  VotingDate <= @VoteDate
GO


这篇关于如何搜索之间的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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