Showing posts with label filled. Show all posts
Showing posts with label filled. Show all posts

Thursday, March 29, 2012

formula in sql server

hi,
my users can make posts in my web application, i mean they fill a form and the information they filled will be saved in sql server 2000 and can be shown in web application,now i want to give each post an Id and save it in the database, how can i do that? does sql server have the abilities or i should do sth in my c# application

thanx

This is something that is best to let the database handle for you.

Set your ID column as an Identity column in your sql table.

Sql server will then set its value to a unique auto incrementing value automatically every time a new row is inserted.

Friday, February 24, 2012

Format Date Parameter in a Report

Hi,
Can I get a Date Parameter that the user filled and format it to
'yyyy-mm-dd' format, so I could execute the Query with the formated date?
LimorIf you are Trying what I think you are trying ...
Here is something you could try
Create a Dataset for your Date Values
I named mine DATE
in the Query type
--
SELECT
LABEL = LEFT([DATEFIELDNAME],11), --WRITES AUGUST 30 2005
VALUE = [DATEFIELDNAME] --WRITES 2005-08-30 00:00:00.000
FROM dbo.SALES
GROUP BY [DATEFIELDNAME]
ORDER BY [DATEFIELDNAME] DESC
--
Then Create a Parameter for your date
I named mine BDATE
DATATYPE = STRING
AVAILABLE VALUES = FROM QUERY
DATASET = DATE (NAME I CREATED)
VALUE = VALUE (THIS IS WHAT THE QUERY IN THE DATASET WILL SEE)
LABEL = LABEL ( THIS IS WHAT THE CLIENT WILL SEE)
--OPTIONAL
DEFAULT QUERY = FROM QUERY
DATASET = DATE
VALUE = VALUE
--
In the dataset that runs the Query for the report you would then have your
date field = @.BDATE (cap sensitive)
I hope this helps and is what you were looking for :)
"Limor Bellison" wrote:
> Hi,
> Can I get a Date Parameter that the user filled and format it to
> 'yyyy-mm-dd' format, so I could execute the Query with the formated date?
> Limor|||Hi,
Thank you for your prompt answer.
I cannot use your solution for 2 reasons:
1-The dates combo box will be too long
2-I get the dates by Url and there is a chance that the date in the combo
will not include the date in the Url query
Thanx,
Limor
"EsWallace" wrote:
> If you are Trying what I think you are trying ...
> Here is something you could try
> Create a Dataset for your Date Values
> I named mine DATE
> in the Query type
> --
> SELECT
> LABEL = LEFT([DATEFIELDNAME],11), --WRITES AUGUST 30 2005
> VALUE = [DATEFIELDNAME] --WRITES 2005-08-30 00:00:00.000
> FROM dbo.SALES
> GROUP BY [DATEFIELDNAME]
> ORDER BY [DATEFIELDNAME] DESC
> --
> Then Create a Parameter for your date
> I named mine BDATE
> DATATYPE = STRING
> AVAILABLE VALUES = FROM QUERY
> DATASET = DATE (NAME I CREATED)
> VALUE = VALUE (THIS IS WHAT THE QUERY IN THE DATASET WILL SEE)
> LABEL = LABEL ( THIS IS WHAT THE CLIENT WILL SEE)
> --OPTIONAL
> DEFAULT QUERY = FROM QUERY
> DATASET = DATE
> VALUE = VALUE
> --
> In the dataset that runs the Query for the report you would then have your
> date field = @.BDATE (cap sensitive)
>
> I hope this helps and is what you were looking for :)
> "Limor Bellison" wrote:
> > Hi,
> >
> > Can I get a Date Parameter that the user filled and format it to
> > 'yyyy-mm-dd' format, so I could execute the Query with the formated date?
> >
> > Limor