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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to create a View

Status
Not open for further replies.

RSmithwvsf

IS-IT--Management
Aug 5, 2008
12
US
i need to create a view to comapare data from two different tables
tbl1, will show r.id, fname,lname,admit,ftype
tbl2 will show p.id,p.date
now i need to see only recors where tbl1.admit=1 and tbl1.ftype = 'il'and where tbl2.date={?Date}and tbl2.id<>tbl1.id
pluse the date feild is a numaric feild and mus be coverted in the view to a date feild that can be entered by a user running crystal reports

any ideas
 
What version of PSQL are you using?
What have you tried so far? Are you getting errors?
A simple view would be:
Code:
CREATE VIEW v1 AS SELECT * FROM CLASS

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
i have created the view that will give me the p.id and p.date feild but this feild is a count of days from jan 1 0001 day one of the first year and i am not sure how to show it right in the view. also created a secound view that gives me r.id fname lname admit and ftype
 
For converting the data, you might be able to use something along the lines of:
Code:
TIMESTAMPADD ( SQL_TSI_DAY, "table name"."field.name", CONVERT('0001-01-01', SQL_TIMESTAMP) ) -1

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top