TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Goran Bibic
455
2.9k
198k
Datetimepicker Selection just for one day...?
Mar 26 2018 3:15 AM
Datetimepicker from and datetimepicker to....
Work just for one day exp, 16.03.2018....16.03.2018
Work fine
If choose 01.03.2018 to 16.03.2018 dont work...
What I wrong?
private
void
radni_sati2()
{
String cs =
"Data Source=.\\SQLEXPRESS;Initial Catalog=bss_prijava_radnika;Integrated Security=True"
;
using
(SqlConnection openCon =
new
SqlConnection(cs))
{
string saveStaff =
"SELECT a.IdPrijava, a.redni_broj , a.radnik, isnull(convert(varchar(20), a.vrijemeodjave, 113), '') as vrijemeodjave, convert(varchar(20), b.vrijemeprijave, 113) as vrijemeprijave, "
+
"CASE WHEN (DATEDIFF(SECOND, b.vrijemeprijave, a.vrijemeodjave) / 3600) > 8 THEN 8 ELSE(DATEDIFF(SECOND, b.vrijemeprijave, a.vrijemeodjave) / 3600) END AS radni_sati, "
+
"CASE WHEN(DATEDIFF(SECOND, b.vrijemeprijave, a.vrijemeodjave) / 3600) > 8 THEN(DATEDIFF(SECOND, b.vrijemeprijave, a.vrijemeodjave) / 3600) - 8 ELSE NULL END AS prekovremeni "
+
"FROM(SELECT IdPrijava, redni_broj, radnik, vrijemeodjave, ROW_Number() OVER(Partition By IdPrijava ORDER BY vrijemeprijave) as RowNum "
+
"FROM dbo.prijava_radnika) a INNER JOIN(SELECT IdPrijava, redni_broj, radnik, vrijemeprijave, (ROW_Number() OVER(Partition By IdPrijava ORDER BY vrijemeprijave) - 1) as RowNumMinusOne FROM dbo.prijava_radnika) b ON a.IdPrijava = b.IdPrijava where 1 = 1 "
;
if
(!string.IsNullOrEmpty(textBox1.Text))
{
saveStaff +=
" AND a.radnik LIKE \'%"
+ textBox1.Text +
"%\' "
;
}
if
(checkBox1.Checked)
{
String strFilterDTP1 = dateTimePicker1.Value.ToString(
"yyyy-MM-dd"
);
String strFilterDTP2 = dateTimePicker2.Value.ToString(
"yyyy-MM-dd"
);
saveStaff +=
" AND b.vrijemeprijave between '"
+ strFilterDTP1 +
" 00:00:00' AND '"
+ strFilterDTP1 +
" 23:59:59' "
;
saveStaff +=
" AND a.vrijemeodjave between '"
+ strFilterDTP2 +
" 00:00:00' AND '"
+ strFilterDTP2 +
" 23:59:59' "
;
}
String someDate =
"25 Mar 2018 13:13:00"
;
DateTime someDT = DateTime.Parse(someDate);
Console.WriteLine(saveStaff);
Reply
Answers (
4
)
Diff between Xamarin Component Store and NuGet?
Unable to start debugging on the webserver.