Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 join help

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2011-03-16 : 01:38:34
my tables are

CREATE TABLE [dbo].[formentries] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[entryid] [int] NULL ,
[storeid] [int] NULL ,
[formid] [int] NULL ,
[entrydate] [datetime] NULL
) ON [PRIMARY]
GO



CREATE TABLE [dbo].[formfields] (
[formfieldid] [int] IDENTITY (1, 1) NOT NULL ,
[formid] [int] NULL ,
[fieldname] [nvarchar] (150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[fieldtypeid] [int] NULL ,
[fieldrequiredid] [int] NULL ,
[fieldinstructions] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[orderby] [int] NULL ,
[storeid] [int] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[formvalues] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[formfieldid] [int] NULL ,
[formfieldvalue] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[entryid] [int] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[forms] (
[formid] [int] IDENTITY (1, 1) NOT NULL ,
[formname] [nvarchar] (150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

[thankyoutext] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO





my challenge here is a query that will return a table with form id it should return a table of all entries (filled in by formvalues)

so for example my data in formfields is

1 myfirstname
2 mylast name


and
in fieldtype
1 -firsntame
2 lastname
it should return

Firstname lastname

myfirstname mylastnames


can someone help me with this?
   

- Advertisement -