Question : troubles getting BETWEEN logic to work

Hi..

I am trying to decipher the between statement......using a restriction of salaries......I used the following code......it creates the table headers, but no data was inserted during the query of salary restrictions:

select * from employees
        join jobtitle on employees.job_title_id = jobtitle.job_title_id
where employees.salary between 15000.00 and 25000.00

My friend told me that this code would work.....
SELECT e.*, jt.*
FROM employee e
JOIN job_title jt ON (jt.eeo1classification = e.eeo1classification)
WHERE Salary BETWEEN 6 AND 7  

(obvious different table schema's than mine)


MY CODE of TABLES creation.....

any ideas would be appreciated

USE [mydatabase]
GO
/****** Object:  Table [dbo].[jobtitle]    Script Date: 07/22/2010 16:07:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[jobtitle](
      [JOB_TITLE_ID] [char](1) NOT NULL,
      [EEO_1_CLASSIFICATION] [char](50) NULL,
      [JOB_TITLE] [char](100) NULL,
      [JOB_DESCRIPTION] [char](300) NULL,
      [EXEMPT_NON_EXEMPT_STATUS] [char](20) NULL,
PRIMARY KEY CLUSTERED
(
      [JOB_TITLE_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[employees]    Script Date: 07/22/2010 16:07:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[employees](
      [EMPLOYEES_NUM] [char](2) NOT NULL,
      [LAST_NAME] [char](15) NULL,
      [FIRST_NAME] [char](15) NULL,
      [ADDRESS] [char](50) NULL,
      [CITY] [char](15) NULL,
      [STATE] [char](2) NULL,
      [TELEPHONE_AREA_CODE] [char](3) NULL,
      [TELEPHONE_NUMBER] [char](7) NULL,
      [EEO_1CLASSIFICATION] [char](50) NULL,
      [HIRE_DATE] [char](8) NULL,
      [SALARY] [decimal](8, 2) NULL,
      [GENDER] [char](1) NULL,
      [RACE] [char](30) NULL,
      [AGE] [char](2) NULL
) ON [PRIMARY]
SET ANSI_PADDING OFF
ALTER TABLE [dbo].[employees] ADD [job_title_id] [char](1) NULL
ALTER TABLE [dbo].[employees] ADD PRIMARY KEY CLUSTERED
(
      [EMPLOYEES_NUM] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  ForeignKey [FK_Employees_Job_Title]    Script Date: 07/22/2010 16:07:18 ******/
ALTER TABLE [dbo].[employees]  WITH CHECK ADD  CONSTRAINT [FK_Employees_Job_Title] FOREIGN KEY([job_title_id])
REFERENCES [dbo].[jobtitle] ([JOB_TITLE_ID])
GO
ALTER TABLE [dbo].[employees] CHECK CONSTRAINT [FK_Employees_Job_Title]
GO

Answer : troubles getting BETWEEN logic to work

If you deselect Word as the default email editor you won't have this problem.
You can try closing Word and Outlook (completely, meaning not open in Background) and then try opening word, it should work properly.
Otherwise another workaround is to only send maximized email messages.
Random Solutions  
 
programming4us programming4us