DECLARE @LastDayOfYear Date, @GetHour INT , @NextNewDate DateTime
SET @LastDayOfYear = DATEADD(yy, DATEDIFF(yy,0,GETDATE()) + 1, -1)
SET @GetHour = datepart(hour, GETDATE()) -- returns hour
--Get Today date to compare to the last day of December in current year
IF (FORMAT(GETDATE(), 'yyyy-MM-dd') = FORMAT('2014-05-28', 'yyyy-MM-dd')) AND (@GetHour >=15)
EXEC msdb.dbo.sp_stop_job @job_name='Testjob'
Then created step 2 to call the stored procedure I have created
I then created a scheduler to test it out with today date starting from 11am and every 5 mins with recurring mode.
For some reason, it nevers call the stored proc which should have from step 1 to step 2
I have mysql database and employee details table is there with the column joining date.
i need to write a query in mysql in such a way that i should compare joining date with today date since i need to display employee details who are going to complete exactly 1 yr, 2 yr , 3yr ... and so on.
Joining_Date Current_Date Years_Completed
2010-05-26 2014-05-26 4 years
2000-05-26 2014-05-26 14 years
2010-04-26 2014-05-26 4 years this row should not come since one month is less
only for todays date they should exactly complete years
How to achieve this. If anybody knows, please reply me.
if todays date is 2014-05-26 then
1. 2012-05-25 if u consider 2 years means 730 (365 X 2) days will come but in this 731 that 2 years 1 day so we should display this, it should complete exactly year
2. 2012-05-26 i think this is coming 730 days means 2 years exactly we can display
3. 2012-05-27 in this 1 day required to complete exactly 2 years now it is 729 days
4. 2013-05-27 in this 364 is coming it should be 365 to complete a year so we should display this record
Don't know MySQL but you should be able to break the datetime object into day/month/year/time components. Select from the table where the day = day and the month = month, ignoring the year and time components.
Never underestimate the power of human stupidity
DECLARE@JoiningDateDATESET@JoiningDate = '10/10/2013'IF (YEAR(GETDATE()) > YEAR(@JoiningDate))
BEGINIF (DAY(@JoiningDate) = DAY(GETDATE()) AND DAY(@JoiningDate) = DAY(GETDATE()))
This will exceute on every year of joining date.
Below is the print statement to check the testing result.
*/PRINTCONVERT(NVARCHAR,(YEAR(GETDATE()) - YEAR(@JoiningDate))) + ' Year(s)'ENDEND
I have created a report in Access2010 and seems like the data alignment in report view is not what I want. My current view is like the pix in the following URL. Is it possible to have those tasks shown just below the headers (months)?
I tried to merge those cells for display or even those criteria like Does Not Equal blank but both are not what I want. Or should I better modify my query?
For the query I am using, it is a bit "weird" and I wonder that is the main reason I can't get those tasks aligned to top. However, some of the tasks may have StartDate and/or DueDate empty. A big thank you in advance for your help since I seldom work with MS Access. Thanks in advance!!!
TRANSFORM [Tasks].[TaskTitle] AS [the value]
FROM Projects LEFTJOIN Tasks ON [Projects].[ID] =[Tasks].[ProjectID]
GROUPBY [Projects].[ProjectName], [Tasks].[TaskTitle]
PIVOT Format ([Tasks].[StartDate], "MMM-YYYY");
When I call The Stored Procedure directly from Sql Server it adds or
subtracts stock qty properly, but when i run it through vb6 code it adds or
subtracts qty twice. But its not in every execution of SP.
I m running my software for 3 to 4 years it never happened like this in SQL
1. Turn on SQL Profiler and start it running against your database
2. execute the stored procedure from the VB application
3. stop the profiler
4. in the results from the profiler you can see what was executed and the values that were passed to the stored procedure
Sounds like this may be the issue that finally gets him to update/rewrite his app into a current language. Now there will be a whole lot of pressure while he could have started this a decade ago (so speaks the guy still coding in Silverlight ).
Never underestimate the power of human stupidity
While VB 6 may have it issues, I have written and used in production many applications written in VB 6 pulling data from SQL Server without issue. If there is a problem, I suspect it is with the coding, not the underlying foundations.
While VB 6 may have it issues, I have written and used in production many applications written in VB 6 pulling data from SQL Server without issue.
Ditto. I never claimed that VB6 has issues with SQL Server - merely that it existed before Sql 2008. VB6 does not know about Sql2k8, and I doubt that new released Sql versions are tested for backward compatibility for a discontinued product.
Tim Carmichael wrote:
I suspect it is with the coding, not the underlying foundations.
I agree with the first part of this statement, and explained how the underlying foundation can cause this.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]