Wrox Programmer Forums
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 23rd, 2007, 06:34 PM
Authorized User
Join Date: Aug 2004
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default Date Function

Hi all I have a database that has SQL Server as the engine and Access 2003 on the front end. I am converting a MDB to an ADP but Jet SQL and Sql Server are like apples and oranges they dont exactly speak the same language. I need for the users to create a function that allwos users to enter BETWEEN [Enter the Start Date] AND [Enter the End Date] from 1/21/2005 to 1/31/2005 In access theres a parameter box that pops up and allows the users to enter in an End date and a Beginning date then it generates a report for them or a query which ever. How do you do this in SQL, I have a database that I created that has the same thing as a function its like this: =@Enter_FINALSUITEDONE then a dialog box pops up and allows them to enter in a final suit date and then they can see all the finals for that date. Can anyone help me please

SELECT [Main Table].[IR Number], [Main Table].Date, [Main Table].Inspector, [Main Table].Area, [Main Table].Violation, [Main Table].[Violation Type], [Main Table].Loss, [Main Table].[Loss Type], [Main Table].Employee, [Main Table].Action, [Main Table].[Action Type], [Main Table].Notes
FROM [Main Table]
WHERE ((([Main Table].Date) Between [Enter the Start Date] And [Enter the End Date]))
ORDER BY [Main Table].[IR Number]

Old March 26th, 2007, 04:28 AM
Authorized User
Join Date: Aug 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to bishnupokhrel Send a message via Yahoo to bishnupokhrel

hi desireemm,

you can create a access form which asks for two values, and replace the values and fire the query, its seems simple to me

strQuery = " ... WHERE ((([Main Table].Date) Between [Enter_the_Start_Date] And [Enter_the_End_Date])) ... "
strQuery = replace(strQuery,"Enter_the_Start_Date", first_value)
strQuery = replace(strQuery,"Enter_the_End_Date", second_value)

execute the query and you are done.

let me know if i am wrong.

Bishnu Pokharel

Similar Threads
Thread Thread Starter Forum Replies Last Post
Date function issue Grafixx01 Access 2 April 11th, 2007 02:32 PM
ASP Date Function cancer10 Classic ASP Databases 3 January 5th, 2007 06:35 PM
Date Picker Function MunishBhatia Javascript How-To 1 December 18th, 2006 01:30 AM
between date function surendran SQL Server 2000 2 October 19th, 2006 09:31 PM
ASP Date Function Ken11 Classic ASP Basics 3 September 30th, 2003 02:04 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.