Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

UDF not working - passing a date parameter

Avatar of metropia
metropiaFlag for United States of America asked on
Microsoft SQL ServerSQL
15 Comments1 Solution593 ViewsLast Modified:
I created a UDF named: [dbo].[RG_DailyShippingStatusReportMonthToDate]

When I call the function like:

SELECT * FROM [dbo].[RG_DailyShippingStatusReportMonthToDate] (getdate())

I get: Line 1: Incorrect syntax near '('.

Then I replace GETDATE() with the values Ialso used when testing the function with hard-coded values:

SELECT * FROM [RGMFG].[dbo].[RG_DailyShippingStatusReportMonthToDate] (‘2013-04-01’)

But I get zero results.

I have included a copy of this UDF from when I was using hard coded values. When running it that way, I  do get results.

I am also including a copy of it, not using hard coded values.

Would someone be willing to take a look at this and see if you can locate where I am making the mistake?

Thank you very much
udf-with-hard-coded-values.txt
udf-with-out-values.txt
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Commented:
This problem has been solved!
Unlock 1 Answer and 15 Comments.
See Answers