Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Problem in Stores Procedure

Status
Not open for further replies.

prodtest

Technical User
Aug 29, 2003
55
GB
Hi,
Im new to ADP's, I having trouble passing dates to a stored procedure.

I have a TextBox on a form with no date formats set on it, it has the mask set to date ( 00/00/0000 ).

The procedure has (dbo.transactions.date BETWEEN @startdate AND @enddate) as I criteria.

The subform that runs of the procedure has got its input parameter set to
@startdate = Forms!ordersearch!Text6, @enddate = Forms!ordersearch!Text8

When I refresh the subform it just sits there doing nothing.

It does have other criteria in the procedure, but it works fine with just those selected, but when I add the date criterias it goes all wrong !!

Any ideas anyone ?

Cheers

Ben
 
Hi,
More information on this problem I have:

If I run the stored procedure with out opening the form I can enter the criteria manually when asked inc the dates and it all works ok.
So i must have a problem transfering the date content form the text boxes on my form to my procedure.

AAARRRGGGHHH

someone help please !!! Im lost !!!

Ben
 
For the stored procedure variables are you using the datatype varchar(10)? Also, for the input mask try "99/99/0000;0;_".
 
Are you refreshing the subform through vba code. If so, put a debug.print before the refresh and show what is in the date fields.
Is the main form sitting on a record with content, or have you tabbed to a new record.
 
the formatting of date strings in sql server is:
yyyy-mm-dd

if you format all your input dates like that then you'll be fine...

--------------------
Procrastinate Now!
 
Hi thanks for your help, I have sort of managed to get it working but the date needs to be entered into the textbox in US format mm/dd/yyyy, not good for UK users (damn users!!).

Any ideas how I can get it to accept it in UK format
dd/mm/yyyy ???


Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top