i would like to create a function which accepts a constant like
the datepart function accepts yy/mm/dd/hh/
like:
select datepart(dd, getdate())
i would like to create my own function that accepts dd
not char like 'dd'
i want
select MyFunc(dd, getdate())
and not
select MyFunc(‘dd’, getdate())
I think you’re out of luck on this. If you don’t single-quote the characters, they’ll be interpreted as a name–but you can’t have defined them as a name anywhere if you want them to be used in the manner you propose.