Solved

I have some data that is being enter into the system and sometimes the user will hit an extra key. I need to know how to averge this data so that I will know that the user hit an extra key.

Posted on 2014-04-30
4
177 Views
Last Modified: 2014-05-14
For instance the user normally average anywhere from 20 to 25 snacks a day. So when entering in this data 123 is entered which is an error. I want to flag the error . I am a beginner with Sql so if you could explain I will appreciate.

Thanks
0
Comment
Question by:JakiYoung
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 40032656
You could add a CHECK constraint on the column, specifying a maximum value that SQL will allow in the column.  For example:

ALTER TABLE dbo.tablename
ADD CHECK(snack_count_column BETWEEN 0 AND 65)

would allow 0 through 65 to be entered for that column's value.
0
 

Author Comment

by:JakiYoung
ID: 40032784
I have 185 sites and the number can vary from site to site.
0
 
LVL 69

Accepted Solution

by:
Scott Pletcher earned 500 total points
ID: 40032870
You could use a lookup table, with different limits per site, to validate the data.

If you can't specify the limit, how do you expect SQL to know the data is bad??
0
 

Author Comment

by:JakiYoung
ID: 40032878
what about averaging the records
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question