Skip to content
Advertisement

Tag: sql-server

using DateDiff to find duration in minutes

I am trying to use Datediff to find out the duration between columnA and columnB. This produces errors. Can anyone please help me with what I’m doing wrong? Answer how about trying this, not sure why you have stime = [exceptions2].starttime and etime = [exceptions2].endtime

The parameterized query expects the parameter which was not supplied

I’m having a problem with my code: Once I typed in the string in the textbox to search for an item I get this error: The parameterized query ‘(@Parameter1 nvarchar(4000))SELECT * FROM borrow where (Departme’ expects the parameter ‘@Parameter1’, which was not supplied. Can anyone help me? Answer If you pass null value to parameter,you will get this error even

Get the 2 digit year in T-SQL

I need to get the current 2 digit year and increment by one. So the current number I’m looking for should be 11. Probably really simple but I’m a sql noob 🙂 Thanks Answer You can do ( YEAR( GETDATE() ) % 100 ) + 1 See GETDATE & YEAR

Should every SQL Server foreign key have a matching index? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 7 months ago. The community reviewed whether to reopen this question 7 months ago and left it closed: Original close reason(s) were not resolved Improve this question

Advertisement