Showing posts with label beginning. Show all posts
Showing posts with label beginning. Show all posts

Thursday, March 29, 2012

End Date and Beginning date in an ADP

Can anyone pleae help me, I inheited this databas which is an MDB and I have to convert it to an ADP (Sql server is the engine) and I need for my users to be able to enter a end date and a beginning date when they first open a report so they can see from the end of the month to the beginning in one report. This is Accesses code as an MDB

Code Snippet

[code]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]

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 [IR Number]
GO

And here is SQL Servers code the only problem is that when I run this in the Query analyzer it gives me an error message that says, can anyone help me please?

"Server: Msg 207, Level 16, State 3, Line 1
Invalid column name 'Enter the Start Date'.
Server: Msg 207, Level 16, State 1, Line 1
Invalid column name 'Enter the End Date'."

Change the [Enter the start date] placeholders to parameters (@.StartDate @.EndDate)|||

Oh thank you so much is this what you mean?

Code Snippet

SELECT [IR Number], Date, Inspector, Area, Violation, [Violation Type], Loss, [Loss Type], Employee, Action, Notes, [Action Type]
FROM dbo.[Main Table]
WHERE (Date = @.StartDate) AND (Date = @.EndDate)

|||

You can still use the BETWEEN clause

Code Snippet

SELECT [IR Number], Date, Inspector, Area, Violation, [Violation Type], Loss, [Loss Type], Employee, Action, Notes, [Action Type]
FROM dbo.[Main Table]
WHERE Date IS BETWEEN @.StartDate AND @.EndDate

|||

Whoops, the 'IS' should not be in there

Code Snippet

SELECT [IR Number], Date, Inspector, Area, Violation, [Violation Type], Loss, [Loss Type], Employee, Action, Notes, [Action Type]
FROM dbo.[Main Table]
WHERE Date BETWEEN @.StartDate AND @.EndDate

|||

BRUCE YOU ARE THE BEST THANK YOU SO MUCH YOU DONT KNOW HOW LONG I HAVE BEEN WRESTLING WITH THIS

I inherited this database and I have queries that have to be converted from an MDB to an ADP and its not easy.

thank you so much

sql

Friday, February 24, 2012

Enable SQL Server 2005 Remote Connections in Windows 2000

Hi,
I setup SQL Server 2005 on a Windows 2000 Professional machine. The
MSSQLSERVER service seems to be running fine in the beginning but does
not restart if I enable connections via TCP/IP.
I have this problem only on a Windows 2000 machine and it works fine if
I setup SQL Server 2005 on a Windows XP machine.
- ramadu
:
> Thanks for your response Sri,
> Hope that will help you resolve the problem. If you meet any further
> problem, please feel free to post here.
> Regards,
> Steven Cheng
> Microsoft MSDN Online Support Lead
>
> ========================================
==========
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
==========
>
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>Hi Ramadu,
Thank you for your post.
Since Steven is Out of Office, I will take response of this issue.
Would you please provide some detailed information for me to troubleshoting?
1. Please let me know if there is any error in Event log when you start SQL
Server.
2. Please let me know if there is any error message in the SQL error log.
By default, the error log is located at Program Files\Microsoft SQL
Server\MSSQL.n\MSSQL\LOG\ERRORLOG
Please let me know the result and so that I can provide further assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.