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
David Smith
NA
2k
0
SQL fiscal year logic help
Sep 3 2012 11:43 AM
Is there a simpler way to write this logic below in c sharp or an Sql query, i am using access database
case 14://Current Fiscal Year
string TempYear = string.Empty;
if (DateTime.Now.Month < 7)
{
TempYear = string.Format("{0}", ((DateTime.Now.Year) - 1));
}
else
{
TempYear = string.Format("{0}", DateTime.Now.Year);
}
string FiscalYearStart = "7/1/" + TempYear;
string FiscalYearEnd = "6/30/" + (TempYear + 1);
sqlDateFilter = "tblService.ServiceDateStart >= #" + FiscalYearStart + "# AND ServiceDateStart <= #" + FiscalYearEnd + "#";
break;
Reply
Answers (
1
)
RAID Configurations in SQL
dataGridView doesnt update SQL table