Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / January 2006

Tip: Looking for answers? Try searching our database.

Interact with SQL database

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carlos - 25 Jan 2006 12:31 GMT
Hello everybody,

I have made a form (new from Data Connection)with a data connection SQL
database. I have created a data source without any table, and an SQL
statement, the following:

SELECT DISTINCT t.Ticket
              ,t.Updated_By AS Ticket_Updated_By
              ,a.Updated_By AS Activity_Updated_By
              ,t.Summary
              ,t.Status
              ,count(*) as Num_Activities            
FROM HD_Tickets t
JOIN HD_Ticket_Activity a
 on t.ID = a.Ticket_ID
WHERE a.ID IN (SELECT a.ID
              FROM HD_Ticket_Activity a
              WHERE a.Ticket_ID = t.ID
                AND a.Updated_By IN ('juan justo')
--               AND cast(floor(cast(a.Submit_Date as float)) as datetime)
--                     BETWEEN CONVERT(datetime,'2006-01-23',120)
--                         AND CONVERT(datetime,'2006-01-23',120)
            )
GROUP BY t.Ticket
       ,t.Updated_By
       ,t.Summary
       ,a.Updated_By    
       ,t.Status

The form is working properly, but I have a question, I would like Infopath
to ask me for some data before doing the 'query', for instance he
'Updated_By' and Dates that are shown in the SQL statement, I really don't
know how to integrate them,

any advise will be really appreciated,
The best regards,
Carlos
Sandeep - 27 Jan 2006 07:05 GMT
Hi Carlos

This is C# code.
Write this code before the query code.

if( (Updated_By == null || Updated_By.Length == 0) && (Dates == null ||
Dates.Length == 0))
{

thisXDocument.UI.Alert(string.Format("{0} enter your mesage here  {1} ",
Updated_By ,Dates));

}

I hope this will help U.

Sandeep
www.autonomysystems.com
Carlos - 27 Jan 2006 15:38 GMT
Hello, thanks Sandeep, I dind't suppose that programming was neccesary, I'm a
newbie in infopath (also in programming) and I thought this funcionality was
possible in another way.

I will try with my colleagues here, maybe they can arrange this,

Anyway thanks very much and the best regards,
Carlos.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.