|
Because there are times when you do need to store just a date or just a time. The OP's example just isn't one of them.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
You could try and merge DATE_CREATED and TIME_CREATED to get a DATETIME value then you could use between.
Something like (most likely will not work as written):
(Date_Created + Time_Created) BETWEEN @startdatetime AND @enddatetime
|
|
|
|
|
As others have said, the time should be part of the DATE_CREATED column. However, it's still possible to get what you need:
WHERE
(DATE_CREATED = '20140902' And Convert(time, TIME_CREATED) >= '05:00:00')
Or
(DATE_CREATED = '20140903' And Convert(time, TIME_CREATED) <= '05:00:00')
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you so much for the help, my query is working fine now.
|
|
|
|
|
That is great!
I get started down a path and do not think outside of that.
|
|
|
|
|
convert function is not working in access
|
|
|
|
|
select * from Staging.[dbo].AD where DATE_CREATED between '2013-03-08 05:00:00' and '2013-03-09 05:00:00'
-- I hope i will help u...
|
|
|
|
|
I need to send an email from a stored procedure, I found I use msdb.sp_send_dbmail, can someone give a suggestion on how I can do it except calling this built-procedure in sql server? Thanks.
|
|
|
|
|
I use sp_send_dbmail - I can't think of any other methods provided by sql server which will do this.
For security reasons I have the stored procedure, which runs this, within the msdb database as certain permissions, which I am unwilling to give to users, are needed to run this stored procedure.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
thank you very much for your reply.
Can you tell me what the best practice is for notifying an developer if an error occurred in a stored procedure?
|
|
|
|
|
Just throw the exception.
There is no reason, I can think of, that you should need to catch an exception from a stored procedure.
Throwing the exception will allow the developer to have an error message and pursue fixing the error.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Member 1284721 wrote: Can you tell me what the best practice is for notifying an developer if an error occurred in a stored procedure?
What happens if the stored proc doesn't run at all?
|
|
|
|
|
The sproc is there to provide the functionality.
If it is there, and works, and you need such, why ask for "any" solution that excludes it? Why "except"?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
You can always have a .NET program run the procedure taking data from it and email from the .NET program.
|
|
|
|
|
|
Hi,
I need your advise please..
here is the detail:::
The employee contract can be definite (with expiry date) or indefinite (open without expiry date).
The employee contract will always have date of join
if the contract is definite then employee will have 30 days every year where the year is the period between the date of join and +365 days and the renewal is the same (from the renewal date and +365)
if the contract is indefinite then employee will have 30 days every year where the year is the period between the date of join it's every 365 days so the contract has not renewal but the employee will have 30 days annually.
for example, if indefinite and date of join is 1 April 2010 then every period from 1 April until 30 March will have 30 days for the employee
I want to calculate the leaves for the employee without having to keep a renew table so it will be calculated based on the leave date and the first date of join.
hope I explained it well...
Technology News @ www.JassimRahma.com
|
|
|
|
|
so the data will be just one leave table with from and to indicating the leave period for every leave and the result will be
1 April - 31 March - [Total Taken Leaves] - [Total Remaining Leaves]
Technology News @ www.JassimRahma.com
|
|
|
|
|
|
I have HTML content in string variable (from to ) within store procedure. The html contains one table with 'n' number of rows and columns. Its my final output which i will publish in mail.
My need is : I want to workout on last column in this HTML, and highlight background with RED color whichever SLA missed (As my last column having date and want to highlight entries less than today's date)
How to achieve this. Please help.
|
|
|
|
|
How about learning CSS? (or HTML...)
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Please go through my first line.
"I have HTML content in string variable (from to ) within store procedure"
As i mentioned, this need to be achieved in STORE PROCEDURE. How to do this?
|
|
|
|
|
Hello,
I'm looking for a free (or cheap) and simple tool to design a SQL database. I just would like to be able to generate the standard SQL from the tool.
What do you suggest?
|
|
|
|
|
|
Microsoft® SQL Server® 2008 Management Studio Express? With Management Studio Express I can create tables then generate SQL for MySQL?
|
|
|
|
|
B413 wrote: generate SQL for MySQL?
Where in your original post did you say MySQL? If a generic SQL question is asked here, more that likely, the response will be Microsoft SQLServer biased.
|
|
|
|